Integrations
Sources
PostgreSQL

How to sync data from PostgreSQL into Knock

Sync PostgreSQL models to Knock users, tenants, objects, audiences, and subscriptions.

Knock connects to PostgreSQL with a database user and password. Every environment in your account can sync from the warehouse once it's connected.

Add the warehouse

#

To add or edit a warehouse, you need the owner or admin role, or a custom permission group that's allowed to manage integrations.

  1. Go to Platform > Sources.
  2. Under Connect a new source, click PostgreSQL.
  3. Enter a Name and a Key. The key can't be changed later.
  4. Click Add warehouse. Knock opens the warehouse's Details tab.

Connect PostgreSQL

#
  1. Create a read-only database user for Knock and grant it read access to the tables you'll sync:

  2. On the warehouse's Details tab, fill in the connection and click Save connection:

    FieldWhat to enter
    HostThe database host, such as db.example.com
    PortDefaults to 5432
    DatabaseThe database to read from
    Database userThe user you created for Knock
    PasswordThat user's password
  3. Click Test connection.

Knock doesn't show the password after you save it. To change the connection later, enter the password again.

If your database isn't reachable from the internet, connect through an SSH tunnel.

If you map a TIMESTAMP column to a user's created_at, convert it to TIMESTAMPTZ first. See timestamps.

Once the connection works, create a sync. See create a sync.

New chat