2012-10-15 18 views
2

我想知道爲什麼\d只列出公共模式中的表?我有另一種模式在數據庫中,SPS,但這些表中未列出...PostgreSQL命令沒有列出所有模式

# psql -p 5432 -U postgres -h localhost myDB 
Password for user postgres: 
psql (9.1.5) 
Type "help" for help. 

myDB=# \d 
       List of relations 
Schema |   Name   | Type | Owner 
--------+----------------------------+----------+---------- 
public | tableA      | table | postgres 
public | tableB      | table | postgres 
public | tableC      | table | postgres 
public | table_col_seq    | sequence | postgres 
(4 rows) 

回答

4

你需要改變你的search_path。在psql使用\dn,然後建立自己的search_path

SET search_path = schema1,schema2,public; 
+0

大,謝謝! – littleK