Skip to main content

Striim Cloud 4.1.0 documentation

PostgreSQL Reader simple application

The following application will write change data for all tables in all schemas in database mydb to SysOut. Replace striim and ****** with the user name and password for the PostgreSQL account you created for use by PostgreSQLReader (see PostgreSQL setup) and mydb and %.% with the names of the database and tables to be read. If the replication slot name is not striim_slot, specify it using the ReplicationSlotName property.

CREATE APPLICATION PostgreSQLTest;

CREATE SOURCE PostgreSQLCDCIn USING PostgreSQLReader (
  Username:'striim',
  Password:'******',
  ConnectionURL:'jdbc:postgresql://192.0.2.10:5432/mydb',
  ReplicationSlotName: 'striim_slot',
  Tables:'%.%'
) 
OUTPUT TO PostgreSQLCDCStream;

CREATE TARGET PostgreSQLCDCOut
USING SysOut(name:PostgreSQLCDC)
INPUT FROM PostgreSQLCDCStream;

END APPLICATION PostgreSQLTest;