Connects your local SQL client (psql or GUI) to an Amazon Redshift cluster so you can run queries.
You only need four values: cluster endpoint (host), port (default 5439), database name, and a user/password with CONNECT privilege. Find them in the AWS console under “Clusters → Properties → Endpoint” and “Database”.
Install the PostgreSQL client, then run the psql
command shown in the Syntax section. The -h
flag takes the Redshift endpoint; -p
the port; -d
the database; -U
the user.Enter the password when prompted.
Create a new PostgreSQL connection, paste the same host, port, database, and credentials, and set SSL mode to “require.” GUIs handle the JDBC URL behind the scenes, so clicking “Test” should return “Success.”
Amazon Redshift exposes a PostgreSQL-compatible wire protocol, so any client that speaks Postgres (psql, JDBC, ODBC) can connect.Advanced Postgres features (e.g., extensions) remain unsupported, but core SQL works.
Yes. Export PGHOST
, PGPORT
, PGDATABASE
, PGUSER
, and PGPASSWORD
before running psql
. This keeps credentials out of bash history and CI logs.
Redshift requires SSL by default. Pass sslmode=require
in psql or check the “Use SSL” box in your GUI.Without SSL you will receive FATAL 08001 errors.
Create a read-only role for analysts: CREATE USER analyst PASSWORD '✱'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO analyst;
. Connect using that user instead of the superuser to minimize risk.
Verify the VPC security group allows inbound traffic on port 5439 from your IP. In corporate networks, open proxy/SSH tunnel or whitelist the office egress IP.
.
No. psql is merely a client; any recent 12+ version works even though Redshift’s engine is forked from Postgres 8.0.
Yes. Generate a temporary password using aws redshift get-cluster-credentials
and pass it to psql or your GUI.
Absolutely. SSH into a bastion host and forward local port 5439 to the cluster endpoint, then connect to localhost.