Opens a PostgreSQL session by supplying host, port, user, and database details through the psql CLI or a graphical client.
Learn fast ways to open a PostgreSQL session from the command-line with psql or from popular GUI clients like pgAdmin, DataGrip, and Galaxy.
Use psql
for scripting or remote servers. Choose a GUI such as pgAdmin, DataGrip, or Galaxy when you want visual table browsing, query history, and autocomplete.
psql
?Run a single command that passes host, port, user, and database. If the password is omitted, psql
prompts securely. Environment variables like PGHOST
and PGUSER
shorten the command.
$ psql -h db.example.com -p 5432 -U analyst -d sales
Yes. Copy the URI from your cloud provider or compose it yourself. This works in both CLI and GUIs.
$ psql "postgresql://analyst:My$ecret@db.example.com:5432/sales?sslmode=require"
Open Servers → Register → Server. Fill Host, Port, Maintenance DB, Username, and Password. Click Save; the tool tests the connection immediately.
Select New → PostgreSQL, paste your URI or fill individual fields, and press Test Connection. Accept SSL certificates if prompted, then click Connect.
The prompt changes to databasename=>
in psql
. In a GUI, a green check appears and the schema tree expands. Run a quick query like SELECT NOW();
to confirm.
Create a ~/.pgpass
file or set environment variables in a CI pipeline. GUIs store encrypted credentials in system keychains, which you can disable for stricter policies.
Cloud databases often require sslmode=require
. Use verify-full
for production to validate certificates, and disable
only on trusted local networks.
No. Any role with CONNECT
privilege on the target database can log in.
It’s waiting for your password because PGPASSWORD
is unset and .pgpass
is missing.
Yes. Galaxy Workspaces let you store and share named connections with granular access controls.