K Split X
K Split X

Reputation: 4757

Why doesn't psql show my data even though pgadmin has it

enter image description here

I have a database called demo which has 4 tables.

I run psql -U user1 demo and am able to login, but I cannot see any of the tables.

One of the table is student. I can surely just reimport the data all again, but why wouldn't it show here?

My user1 is full admin and has access to everything, so I don't think it's a user related issue.

All my tables are also owned by user1, if this makes any difference.

I am not using a VM, everything is on my local machine.

Upvotes: 0

Views: 54

Answers (2)

richyen
richyen

Reputation: 10018

You need to add university schema to your search_path. Either you can SET search_path TO ... or add it to search_path in postgresql.conf. Otherwise, you could perform your SELECT with fully-qualified table name:

SELECT * FROM university.student;

Disclosure: I work for EnterpriseDB (EDB)

Upvotes: 1

user330315
user330315

Reputation:

Your tables are located in the schema university you need to use:

select *
from university.student;

To list the tables in that schema, use: \d university.*

Upvotes: 0

Related Questions