Today I Learned

hashrocket A Hashrocket project

Switch database connections in the psql console

You can connect to a different database in the psql console using the \connect command (or \c for short)

$ psql
psql (10.5)
Type "help" for help.

postgres=# \c example
You are now connected to database "example" as user "root".
example=#
See More #sql TILs
Looking for help? Hashrocket developers believe that data quality is as important as code quality. We enjoy all the challenges of relational databases, from finding the fastest index, to structuring data to fit the needs of an application. We're eager to share our experiences; check out PG Casts, our series of free PostgreSQL screencasts.