1. Find the endpoint
- In the AWS console, open RDS → Databases and select your instance (or the Aurora cluster's writer).
- On Connectivity & security, copy the Endpoint and Port.
postgres://myuser:YOUR-PASSWORD@mydb.abc123xyz.eu-central-1.rds.amazonaws.com:5432/postgres?sslmode=require
2. Let pgquery reach it
- Private database (most setups): run pgquery inside the same VPC, for example on an EC2 instance or as an ECS task, and connect to the endpoint from there.
- Publicly accessible database: add an inbound rule to the instance's security group for port 5432 from the IP address pgquery runs on. Never open it to
0.0.0.0/0.
The hosted app at pgquery.dev can reach databases on the public internet. For a database inside a private network, run pgquery yourself next to it:
docker run -p 54280:54280 ghcr.io/hxndrik/pgquery
Common errors
| If you see | Do this |
|---|---|
i/o timeout (or: context deadline exceeded) | The security group or network blocks the connection. Allow port 5432 from pgquery’s address, or run pgquery inside the VPC. |
no pg_hba.conf entry for host … no encryption | The server requires SSL. Add sslmode=require to the connection string. |
password authentication failed | Check the user and password; for IAM authentication, generate a token and use it as the password (tokens expire after 15 minutes). |
Not supported (yet)
pgquery has no SSH tunnel. If you normally reach RDS through a bastion host, run pgquery on that host or inside the VPC instead.