littleK
littleK

Reputation: 20123

PostgreSQL command does not list all schemas

I'm wondering why \d only lists tables in the public schema? I have another schema in the database, sps, but those tables are not listed...

# 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)

Upvotes: 5

Views: 6212

Answers (2)

GtdDev
GtdDev

Reputation: 928

I had this problem i Intellij IDEA Database tab.

I got the soultion doing : Data Sources and Drivers -> YOUR_DATA_SOURCE -> Schemas -> Check "All databases"

Upvotes: 0

Sean
Sean

Reputation: 10206

You need to change your search_path. In psql use \dn and then build your search_path:

SET search_path = schema1,schema2,public;

Upvotes: 8

Related Questions