I know that I can use c
to switch databases using psql
.
Does PostgreSQL have a command that I can use in a different client? In my case I’m using SQLPro on a Mac, and I can easily switch databases from a menu. I wondered whether there’s a command to do that.
2
Answers
c
connects to a different server.No, a Postgres server cannot connect you to another Postgres server. That is the client’s job.
A client may have its own equivalent of
c
.What
psql
does if you usec
is to open a new database connection and close the old one. Whether a different client program has a facility like that or not depends entirely on the implementation of that client program. It cannot be a function of the PostgreSQL server.