PostgreSQL 18 · Connecting

Connect to a database

Open psql against a specific host, port, user and database.

psql -h localhost -p 5432 -U postgres -d mydb

Official PostgreSQL 18 documentation

More connecting commands

All connecting commands · PostgreSQL 18 cheatsheet

Was this page helpful?