Start using PostgreSQL

Switch PostgreSQL databases

Reconnect psql to another database and verify that the new connection uses the intended role.

8 minute lesson

~~~

A connection enters one database. To move from postgres to notes_app, reconnect:

\connect notes_app

You can also choose a role:

\connect notes_app notes_app

Run \conninfo after switching. PostgreSQL opened a new connection; it did not change a database setting inside the old one.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →