To prepare a PostgreSQL source system for PowerExchange CDC, you must perform a few configuration tasks.
Create a PostgreSQL user role that allows PowerExchange to connect to the PostgresSQL database server in logical replication mode to create a replication slot. When you create the role, specify the LOGIN and REPLICATION attributes, for example:
CREATE ROLE
pwx_role
LOGIN REPLICATION;
To use this command, you must have the CREATEROLE or privilege or be a database superuser.
Ensure that the PostgreSQL postgresql.conf configuration file specifies the
wal_level=logical
parameter.
This parameter determines how much information PostgreSQL writes to the Write-Ahead Log (WAL). The setting of
logical
adds information that is required to support logical decoding.
Install the pwx_decode.dll plug-in for creating the replication slot that PowerExchange uses, in one of the following ways:
Copy the pwx_decode.dll plug-in from the PowerExchange root directory to the PostgreSQL lib directory.
When the PowerExchange capture process runs, PostgreSQL uses the pwx_decode.dll plugin to create the "pwx_repl" replication slot.
If you do not have the authority to install the plug-in within the PostgreSQL lib directory, you can copy pwx_decode.dll to another location. You then must manually create the replication slot. To create the replication slot, use the following command, which points to the location of pwx_decode.dll:
SELECT
slot_name
FROM pg_create_logical_replication_slot('pwx_repl', '
path
/pwx_decode')
PowerExchange automatically creates the corresponding replication store table that records the DML changes retrieved from the replication slot, if the table does not already exist. If you need to adjust the replication store table for your source environment, you can manually create the table. See
Manually Creating the Replication Store Table.