postgresql/connect

Connect to PostgreSQL

Connect to PostgreSQL database

postgresql
connect
database

Command

psql -h localhost -U username -d database

Examples

Connect to database

psql -h localhost -U postgres -d mydb

Connect with connection string

psql postgresql://user:pass@localhost:5432/mydb