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.
- Go to Platform > Sources.
- Under Connect a new source, click PostgreSQL.
- Enter a Name and a Key. The key can't be changed later.
- Click Add warehouse. Knock opens the warehouse's Details tab.
Connect PostgreSQL
#-
Create a read-only database user for Knock and grant it read access to the tables you'll sync:
-
On the warehouse's Details tab, fill in the connection and click Save connection:
-
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.