postgresql – How to switch databases in psql?

postgresql – How to switch databases in psql?

In PostgreSQL, you can use the connect meta-command of the client tool psql:

connect DBNAME

or in short:

c DBNAME

You can connect to a database with c <database> or connect <database>.

postgresql – How to switch databases in psql?

At the PSQL prompt, you can do:

connect (or c) dbname

Leave a Reply

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