Crunchy Bridge Postgres Source Setup Guide
Enable Logical Replication
Crunchy Bridge comes with logical replication enabled by default. Ensure that the settings below are configured correctly. If not, adjust them accordingly.
SHOW wal_level; -- should be logical
SHOW max_wal_senders; -- should be 10
SHOW max_replication_slots; -- should be 10
Creating PeerDB User and Granting permissions
Connect to your Crunchy Bridge Postgres through the postgres
user and run the below commands:
-
Create a Postgres user exclusively for PeerDB.
-
CREATE USER peerdb_user PASSWORD 'some-password';
-
-
Grant read-only access to the schema from which you are replicating tables to
peerdb-user
. Below example shows granting permissions for thepublic
schema. If you want to grant access to multiple schemas, you can run these three commands for each schema.-
GRANT USAGE ON SCHEMA "public" TO peerdb_user; GRANT SELECT ON ALL TABLES IN SCHEMA "public" TO peerdb_user; ALTER DEFAULT PRIVILEGES IN SCHEMA "public" GRANT SELECT ON TABLES TO peerdb_user;
-
-
Grant replication access to this user:
-
ALTER ROLE peerdb_user REPLICATION;
-
-
Create publication that you’ll be using for creating the MIRROR (replication) in future.
-
CREATE PUBLICATION peerdb_publication FOR ALL TABLES;
-
Safe list PeerDB Cloud IPs
If you are using PeerDB Cloud safelist the public IPs of your PeerDB Cloud instance by adding the Firewall Rules in Crunchy Bridge.
Where to find Firewall Rules in Crunchy Bridge?
Add the 3 Firewall Rules for PeerDB Cloud
Create Crunchy Bridge Peer in PeerDB
Through the PeerDB UI, create the Crunchy Bridge Postgres Peer using the peerdb_user
that you created in the previous step.
Create peer drop down
Create Crunchy Bridge Peer