Connect a Postgres client
Use PostgreSQL syntax to query Altertable from psql, DBeaver, pgAdmin, or a BI tool. For client-specific setup, see Hex or Metabase.
Prerequisites
You need a PostgreSQL-compatible client, an Altertable catalog name, and lakehouse credentials for the target environment.
Connect
Set the host to postgres.altertable.ai, the port to 443, and the database to your catalog name. Enable TLS and authenticate with your lakehouse username and password.
psql
PGSSLMODE=require psql -h postgres.altertable.ai -p 443 -U YOUR_LAKEHOUSE_USERNAME your_database
Python (psycopg2)
Run your first query
Run this in the connected client:
SELECT 1 AS ok;
The result should contain one row with an ok column equal to 1.
Troubleshooting
Unrecognized PostgreSQL function
The adapter translates PostgreSQL queries for the lakehouse. If a function call fails, check the function name and argument types. If the same call works in PostgreSQL, include the query and error message when contacting support.
TLS negotiation
The Postgres adapter supports standard PostgreSQL SSL negotiation on port 443.
If a connection times out before authentication, check whether your network performs TLS inspection on port 443. Some configurations, including Cloudflare Gateway TLS inspection, may reject PostgreSQL's plaintext SSLRequest preamble.
- Preferred: bypass TLS inspection for
postgres.altertable.ai. - For clients using libpq 17 or newer, add
sslnegotiation=directalongsidesslmode=require. - Clients without TLS-direct support, including Node
pg, require the network bypass.