psql 'postgresql://app:secret@localhost:5432/appdb'

Category: Databases & SQL

psql 'postgresql://app:secret@localhost:5432/appdb'

Connect to PostgreSQL with a connection URI

The postgresql:// URI packs user, password, host, port, and database into one argument that libpq parses, so pg_dump and other tools accept the same string. The password is visible in process listings; fine for local development, avoid in production scripts.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.