pgquery

pgquery / Connect to Neon

Guide · Connect

Connect pgquery to Neon

Neon gives you a standard Postgres connection string. Copy it from the dashboard, paste it into pgquery, and you are in.

1. Copy the connection string

  1. Open your project at console.neon.tech.
  2. Click Connect on the project dashboard.
  3. Pick the branch, database and role.
  4. Turn Connection pooling off for the direct connection (recommended for pgquery), then copy the string.
postgresql://neondb_owner:YOUR-PASSWORD@ep-cool-name-123456.eu-central-1.aws.neon.tech/neondb?sslmode=require

2. Paste it into pgquery

Open the app, paste the string and press Connect.

Things to know

  • Cold starts. A Neon compute that scaled to zero takes a moment to wake up. If the first connect times out, press Connect again.
  • Pooled vs direct. The pooled host (with -pooler in its name) is meant for apps with many short connections. pgquery opens one connection per request, so the direct host is the simpler choice.
  • SSL is required. Keep sslmode=require in the string.
  • Branches. Each Neon branch has its own host. Save one pgquery connection per branch to compare them side by side.

Common errors

If you seeDo this
i/o timeout (or: context deadline exceeded)The compute was waking up. Try again; it connects fast once it is running.
password authentication failedReset the role password in the Neon console (Roles) and copy a fresh string.
… channel_binding …Remove the channel_binding=require parameter from the string and connect again.

Questions

Does pgquery work with Neon?

Yes. Neon is standard PostgreSQL; paste the connection string from the Connect dialog.

Should I use the pooled connection?

Use the direct connection. pgquery makes a few short-lived connections, which the direct host handles fine.

More chapters