Skip to main content

Connect PostgresBusiness plan

Updated Nov 4, 2026

On My Data → Add data → Connect a warehouse or database, choose Postgres. You pick between two modes: Live queries your database directly, in place, every time; Copy brings one table into your workspace and refreshes it once a day. Either way, Cognizon connects with a read-only credential and only ever issues SELECT.

Before you start

  • Create a dedicated, read-only Postgres role for Cognizon: GRANT CONNECT, USAGE, SELECT on the schema and tables it should see. Every query Cognizon runs is also wrapped in a read-only transaction on our side, as a second line of defense.
  • The database must be reachable from Cognizon. If it sits behind a firewall or IP allowlist, allow the IP address shown in the connect form. If it is not on the internet at all, use the SSH tunnel option in Live mode (see below).
  • Connecting a warehouse or database — either mode — requires a plan with connectors enabled (Business or Enterprise). Team and below can still upload files; see Upload Excel or CSV.

Steps — Live (query in place)

  1. On My Data, open Add data → Connect a warehouse or database, then choose Live — query in place.
  2. Pick PostgreSQL.
  3. Fill in the connection: Name, Host, Port (optional, defaults to 5432), Database, Schema (optional, defaults to public), User, Password, and SSL mode (optional).
  4. Not reachable from the internet? Open Connect through an SSH tunnel, add the workspace's SSH public key (shown there) to the SSH user's authorized_keys on your bastion, then fill in SSH host and SSH user (SSH port defaults to 22). With the tunnel open, Host and Port above are the database as your SSH server reaches it — often localhost.
  5. Click Test connection. Save connection stays disabled until a test passes against the exact configuration on screen — changing any field invalidates the last test.
  6. Once saved, pick a Table from the list Cognizon discovered, give it a Dataset name, and register it. It appears on My Data as a Live dataset.

Steps — Copy (bring it into Cognizon)

  1. On My Data, open Add data → Connect a warehouse or database, then choose Copy — bring it into Cognizon.
  2. Set Source type to PostgreSQL.
  3. Fill in Name, Host, Port (optional), Database, Schema (optional), User, Password, and SSL mode (optional).
  4. Click Test connection — Cognizon connects and lists the available tables. Pick a Table from that list.
  5. Click Connect source. Cognizon copies the table into your workspace and refreshes it once a day; there is a separate manual refresh action, too.

Good to know

  • Live mode never copies rows: every answer queries your database directly.
  • Copy mode brings the chosen table into your workspace and keeps it refreshed daily — useful when the source isn't reachable on demand, or you'd rather not have every chat question hit your production database.
  • The password is stored in Google Secret Manager, never in Cognizon's own database, for either mode.
  • Both Postgres modes require a plan with connectors enabled (Business or Enterprise).

FAQ

Does Cognizon ever write to my Postgres database?

No. Cognizon only ever issues SELECT, and every query also runs in a read-only transaction on our side regardless of what role you grant.

My database isn't reachable from the internet. Can I still connect it?

Yes, in Live mode — open "Connect through an SSH tunnel" on the connect form, add the shown SSH key to your bastion's authorized_keys, and fill in the SSH host and user.

What's the difference between Live and Copy?

Live queries your database directly every time, with nothing copied. Copy brings one table into your workspace and refreshes it once a day — useful if the source has to stay off-limits to live queries.

Which plan do I need?

Business or Enterprise. Team and below can upload files but can't connect a live or copied warehouse source.

Why is "Save connection" disabled?

Save requires a passing "Test connection" against the exact configuration currently on screen. Changing any field — even one character — invalidates the last test, so you always save what you actually tested.