PostgreSQL as Source - DSS 6 | Data Source Solutions Documentation

Documentation: PostgreSQL as Source - DSS 6 | Data Source Solutions Documentation

PostgreSQL as Source

Capture

Data Source Solutions DSS supports capturing changes from PostgreSQL location. DSS uses PostgreSQL native client library "libpq" to connect to the PostgreSQL server. For the list of supported PostgreSQL versions from which DSS can capture changes, see Capture changes from location in Capabilities.

Table Types

  • DSS supports capture from regular tables.
  • DSS does not support capture from inheritance tables.

Capture Methods

DSS supports the following methods for capturing changes from PostgreSQL:

Since version 6.1.5/5, capture from PostgreSQL using Direct DBMS Log Reading method is deprecated. The support for this capture method will be removed in the future DSS 6 releases. We encourage you to consider migrating to Logical Replication capture method.

Grants for Log-Based Capture

This section lists the grants required for capturing changes from PostgreSQL database.

If you prefer not to grant SUPERUSER privileges to the DSS database user, the error F_JD023F that will appear during replication activation will provide you with the specific SQL statements that the SUPERUSER privilege would normally execute automatically. You can then manually execute these statements to enable supplemental logging.

Configuring REPLICA IDENTITY

In PostgreSQL, configuring the table-level setting REPLICA IDENTITY is crucial for replication and data capture, especially in cases involving row-level changes. It specifies how PostgreSQL identifies rows in replicated tables, using either a PRIMARY KEY or a UNIQUE INDEX. This is essential for understanding how data changes, such as updates or deletes, are tracked and replicated to another system.

The following options are available for REPLICA IDENTITY, along with their effects on DSS replication:

Without a PRIMARY KEY, DSS cannot replicate tables if REPLICA IDENTITY is set to DEFAULT. Consider adding a PRIMARY KEY in such cases.

If the chosen UNIQUE INDEX is dropped, DSS will not replicate the tables. Consider changing REPLICA IDENTITY to DEFAULT or using a different UNIQUE INDEX.

This option is generally not recommended outside of testing environments.

REPLICA IDENTITY can be configured manually using the ALTER TABLE statement.

For example:

ALTER TABLE <em>table_name</em> REPLICA IDENTITY FULL;

Both capture methods depend on the REPLICA IDENTITY setting of the replicated tables:

Activating Replication with Supplemental Logging option selected (equivalent to dssactivate with option -ol) will set the REPLICA IDENTITY to FULL when using the Direct DBMS Log Reading capture method or when the replication actions require more logging for a particular table.

Capture Limitations

PostgreSQL-Specific Limitations

YugabyteDB-Specific Limitations

Compare and Refresh from Source

DSS allows you to perform only Compare and Refresh from PostgreSQL database (without using Capture). This section describes the configuration requirements for performing Compare and Refresh from PostgreSQL location.

Grants for Compare and Refresh from PostgreSQL

This section lists the grants required for performing only Compare and Refresh from PostgreSQL database.

The DSS database user must be granted the SELECT privilege:

GRANT SELECT ON <em>table_name</em> TO <em>username</em>;

Related Articles