How do I get postgres list databases in PSQL?
I am trying to learn PostgreSQL administration and have started learning how to use the psql command line tool.
When I log in with psql --username=postgres, how do I list all databases and tables?
I have tried d, d and dS+ but nothing is listed. I have created two databases and a few tables with pgAdmin III, so I know they should be listed.
This postgres lists databases:
SELECT datname FROM pg_database
WHERE datistemplate = false;
This lists tables in the current database
SELECT table_schema,table_name
FROM information_schema.tables
ORDER BY table_schema,table_name ;