PostgreSQL no relations found

postgresql

I am running ruby and rails app with postgresql database, and I want to do batch import from text file to the database.

I've configured the database and if I run psql and \l to list all databases, I can see it.

However, after I run rake db:migrate no relations are created in the database and running psql\d in order to check tables, says "No relations found". But the schema is created and I can see the tables in Induction PostgreSQL client (http://inductionapp.com)

Best Answer

The problem may be a namespace issue. You can \dn to list namespaces.

Keep in mind that by default \d only lists relations in the search path, and you can run show search_path to see what this is.

If you want to list relations in a namespace outside the search path, \d mynamespace.* will list them and their attributes. You can also:

set search_path = 'mynamespace';
\d
set search_path = 'public';

To temporarily change the search path for purposes of using \d