PostgreSQL List all databases
To list all databases in PostgreSQL database, first connect to PostgreSQL database using psql command
1 2 |
su - postgres psql |
Now run
1 |
\list |
This will list all available databases.
To change to a database, use command /connect
1 |
\connect DBNAME |
Once you connected to a database, you can list all tables in a database with command
1 |
\dt |