PostgreSQL List all databases

To list all databases in the PostgreSQL database, first connect to the PostgreSQL database using psql command

su - postgres
psql

Now run

\list

This will list all available databases.

Advertisement

To change to a database, use the command /connect

\connect DBNAME

Once you are connected to a database, you can list all tables in a database with the command

\dt
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement