PostgreSQL
This page walks through how to connect Census with your PostgreSQL database.
Last updated
Was this helpful?
This page walks through how to connect Census with your PostgreSQL database.
Last updated
Was this helpful?
This guide will walk you through connecting to PostgreSQL as a destination.
Visit the and click + New Destination.
Select PostgreSQL from the menu.
Enter the requested database credentials:
Hostname
Host name or IP address of database
Port
Port of database (5432 by default for Postgres)
Database Name
Name of database within Postgres to connect to
Username
Username Census will use to connect
Password
Password Census will use to connect
Number of Client Connections
Value between 1 and 8 (default is 1). This is the maximum number of concurrent connections Census will use to connect to database. The default should be fine in most cases, but increasing this value can increase throughput on very large syncs.
Use SSH Tunnel
SSH Hostname
Hostname of the Census accessible SSH Tunnel bastion.
SSH Port
Port of SSH Tunnel bastion.
SSH Username
Username Census will use to connect to bastion.
To use Postgres as a destination, Census requires permission to write to the desired destination tables, as well as read metadata about the table and database structures.
Census allows you to create custom fields in your destination Postgres as a by-product of your sync (see https://github.com/sutrolabs/census-docs/blob/main/syncs/core-concept/README.md#creating-new-fields-on-your-destination-object).
To enable this in Postgres, Census needs to have the required permissions to add columns to your Postgres table.
Run these commands to enable custom fields (in addition to those above).
We support syncing data to Tables in PostgreSQL, but they must have a uniqueness constraint on a column.
Object Name
Supported?
Sync Keys
Behaviors
Table
✅
Primary Keys or Columns with Uniqueness Constraints
Update or Create, Update Only, Add, Mirror
Census can successfully connect to PostgreSQL instances that are using advanced networking controls including region constraints, IP address allow lists, or SSH Tunneling. For more information, see our Network Access Controls documentation.
Default: Off - Toggle on to indicate that Census should connect via an SSH Tunnel. For more information, see
Learn more about all of our sync behaviors in our documentation.
if you want Census to support more Postgres objects and/or behaviors
You may be trying to sync to a table that does not have a uniqueness constraint. If possible, you need to add one to be able to sync to it. The syntax to do so is .
via support@getcensus.com or start a conversation with us via the chat.