मैंने donorस्कीमा 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)
);
मैंने टेबल को प्रति के अनुसार आबाद किया है:
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;
जब मैं दौड़ता हूं:
\dt+ reference.*
अंदर psql मैं reference.donorतालिका देखें :
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)
लेकिन जब मैं दौड़ता हूं \dt+ donor*(या \dt(+)) मैं reference.donorटेबल नहीं देखता :
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)
क्यों कि मैं केवल देख सकते हैं reference.donorअगर मैं चलाने तालिका \dt+ reference.*या \dt+ *.donor?
मैं इसे प्रदर्शित करने की उम्मीद कर रहा था \dt(या \dt+), लेकिन ऐसा नहीं है।
मेरा search_pathस्कीमा शामिल है referenceऔर उपयोगकर्ता के postgresपास स्कीमा पर सभी अनुमतियाँ हैं referenceऔर स्कीमा के अनुसार सभी तालिकाएँ हैं:
GRANT ALL ON ALL TABLES IN SCHEMA reference TO postgres;
बस स्पष्ट करने के लिए, मेरे पास दो donorटेबल हैं, लेकिन वे दो अलग-अलग स्कीमाओं में हैं, oecd.donorऔर reference.donor। ( oecd.donorजब मैं \dt(+)psql के अंदर उपयोग करता हूं तो बिना किसी समस्या के देख सकता हूं )।
search_pathपहले से रखी हो और मेरे बिना पहले से टेबल / स्कीमा के नाम जाने? या क्या मैंinformation schemaउदाहरण के लिए क्वेरी करने से बेहतर हूंSELECT table_schema, table_name FROM information_schema.tables ORDER BY table_schema, table_name;:?