This feature is in and subject to change. To share feedback and/or issues, contact Support.
CREATE LOGICAL REPLICATION STREAM statement starts that runs between a source and destination cluster in an active-active setup.
This page is a reference for the CREATE LOGICAL REPLICATION STREAM SQL statement, which includes information on its parameters and possible options. For a step-by-step guide to set up LDR, refer to the page.
Required privileges
CREATE LOGICAL REPLICATION STREAM requires one of the following privileges:
- The .
- The .
Synopsis
xml version=“1.0” encoding=“UTF-8”?Parameters
Options
Bidirectional LDR
Bidirectional LDR consists of two clusters with two LDR jobs running in opposite directions between the clusters. If you’re setting up , both clusters will act as a source and a destination in the respective LDR jobs. LDR supports starting with two empty tables, or one non-empty table. LDR does not support starting with two non-empty tables. When you set up bidirectional LDR, if you’re starting with one non-empty table, start the first LDR job from empty to non-empty table. Therefore, you would runCREATE LOGICAL REPLICATION STREAM from the destination cluster where the non-empty table exists.
Examples
To start LDR, you must run theCREATE LOGICAL REPLICATION STREAM statement from the destination cluster. Use the . The following examples show statement usage with different options and use cases.
Start an LDR stream
There are some tradeoffs between enabling one table per LDR job versus multiple tables in one LDR job. Multiple tables in one LDR job can be easier to operate. For example, if you pause and resume the single job, LDR will stop and resume for all the tables. However, the most granular level observability will be at the job level. One table in one LDR job will allow for table-level observability.Single table
Multiple tables
Ignore row-level TTL deletes
If you would like to ignore deletes in a unidirectional LDR stream, set the on the table. On the source cluster, alter the table to set the table storage parameter:discard = ttl-deletes option in the statement:

