donorŞemada göre tablo oluşturduk reference:
CREATE TABLE reference.donor (
donor_code smallint PRIMARY KEY,
donor_name character varying NOT NULL,
donor_type smallint REFERENCES reference.donor_type (type_id),
alpha_2_code char(2) REFERENCES reference.iso_3166_1 (alpha_2_code)
);
Ben göre tablo doldurdu:
INSERT INTO reference.donor (donor_code, donor_name, donor_type, alpha_2_code)
SELECT donor_code, donor_name, donor_type, alpha_2_code
FROM reference.donor_template;
Koştuğumda:
\dt+ reference.*
psql içinde reference.donortabloyu görüyorum :
List of relations
Schema | Name | Type | Owner | Size | Description
-----------+----------------+-------+----------+-------+-------------
reference | donor | table | postgres | 16 kB |
reference | donor_template | table | postgres | 16 kB |
reference | donor_type | table | postgres | 16 kB |
reference | iso_3166_1 | table | postgres | 48 kB |
(4 rows)
Ama koştuğumda \dt+ donor*(ya da \dt(+)) reference.donormasayı görmüyorum :
List of relations
Schema | Name | Type | Owner | Size | Description
-----------+----------------+-------+----------+-------+-------------
oecd_cl | donor | table | postgres | 16 kB |
reference | donor_template | table | postgres | 16 kB |
reference | donor_type | table | postgres | 16 kB |
(3 rows)
Neden sadece görebilirsiniz reference.donorkaçarsam tablo \dt+ reference.*veya \dt+ *.donor?
Ben göstermek için bekliyordum \dt(ya da \dt+), ama değil.
Benim search_pathşemayı içerir ve referencekullanıcı postgresşema referenceve şemadaki tüm tablolara göre tüm izinlere sahiptir :
GRANT ALL ON ALL TABLES IN SCHEMA reference TO postgres;
Sadece iki var netleştirmek için donormasalar, ancak iki farklı şemalar bulunmaktadır yani oecd.donor& reference.donor. (Ben psql içinde oecd.donorkullandığımda herhangi bir sorun olmadan görebilirsiniz \dt(+)).
search_pathilk olarak hangi şemanın yerleştirildiğine bakılmaksızın ve bence tablo / şema adlarını önceden bilmeden hepsini görüntüleyecek ? Yoksainformation schemaörneğin sorgulamak daha iyi miyim , :SELECT table_schema, table_name FROM information_schema.tables ORDER BY table_schema, table_name;?