Openflow Connector for PostgreSQL: PostgreSQL 17+ failover slot support¶
Note
This connector is subject to the Snowflake Connector Terms.
Important
Requires runtime-extensions 2026.7.16.14 or later. Applies to PostgreSQL 17 and later only.
On PostgreSQL 17 and later, the connector creates its logical replication slot with failover=true.
The slot is synchronized to standbys by PostgreSQL and survives:
- A primary failover: replication resumes from the new primary.
- A major-version upgrade through
pg_upgrade(for example, 17 → 18), provided the slot is caught up and not conflicting or invalidated at upgrade time.
The connector must be pointed at the primary to get failover protection.
PostgreSQL does not allow failover=true on slots created against a standby.
If the JDBC URL resolves to a read replica, the slot on that node will not have failover protection.
Version is auto-detected. No new connector property is required.
Limitations¶
- PostgreSQL 16 and earlier versions are unchanged. Failover protection is not available on those versions as this is a native PostgreSQL feature that does not exist before PostgreSQL 17.
- Upgrading the connector alone does not retrofit failover onto an existing slot. The connector only sets
failover=trueat slot creation time. To gain failover protection on an existing deployment, see Retrofit failover protection on an existing deployment. - Delivery is at-least-once across a failover. The connector de-duplicates on reconnect.
- The connector does not validate the PostgreSQL configuration described in this topic. If it is missing,
failover=trueis inert and the slot will not survive a failover.
Required PostgreSQL configuration¶
The following configuration must be set by the user. The connector can’t set these.
-
Point the JDBC URL at the primary’s writer endpoint so the connector reconnects to the new primary after a failover. To confirm the connector is connected to the primary, run the following against the connected database. The result must be
false(false = primary, true = standby): -
On the primary, set
synchronized_standby_slotsto list the physical replication slot names of the failover-candidate standbys. Without it, the failover slot may advance faster than the standby receives WAL: -
On each failover-candidate standby, set the following:
wal_level = logical(already required on the primary): set this on standbys so it takes effect on promotion.sync_replication_slots = onhot_standby_feedback = onprimary_conninfomust includedbname=<database>(PostgreSQL 17 requirement).primary_slot_namemust reference a physical slot listed insynchronized_standby_slotson the primary.
Retrofit failover protection on an existing deployment¶
To gain failover protection on an existing deployment, there are two paths available: with re-snapshot or without re-snapshot. Follow the procedures for each path.
Retrofit failover protection without re-snapshotting¶
Warning
Process all existing FlowFiles in the existing connector before you start the new one. The existing connector should have no FlowFiles in queue and should have all processors stopped. Any writes between stopping the existing connector and starting the new connector will not be delivered to Snowflake. Once a slot is dropped, PostgreSQL can’t replay old WAL. If you can’t guarantee a write-free window, use Retrofit failover protection with re-snapshot instead.
Important
Do not add new tables while the connector is in incremental mode. New tables will not be snapshotted.
-
Ensure the connector is fully caught up before proceeding. The
confirmed_flush_lsnshould matchpg_current_wal_lsn(): -
Pause writes on the source tables by running the following against your PostgreSQL source database. Replace
<schema>and<app_role>with your values: -
Wait until all queues in the connector are empty.
-
Stop the connector and disable all Controller Services.
-
Drop the replication slot. The slot name is in the
CaptureChangePostgreSQLprocessor state underreplication.slot.name, or inpg_replication_slots: -
In the parameter context, set Ingestion Type to
incremental. To set this, go to Ingestion Parameters → Ingestion Type → edit the value toincremental. -
Install a new connector. In the top menu, drag down Import from registry. Select postgresql from Flow, select Keep existing Parameter contexts to reuse the same parameter context as the existing connector, then click Import.
-
Start the connector fully, including all Processors and Controller Services.
-
Verify the new slot was created with
failover=trueby running the following against your PostgreSQL source database: -
Resume writes:
-
Optionally, delete the existing connector to prevent accidentally resuming it.
Note
Once all existing tables are in Incremental Replication, change Ingestion Type from incremental to full. To verify, in Snowsight go to Ingestion → Openflow → Connector Observability, select your connector, and confirm all tables show Incremental Replication in the Replication Phase column.
Retrofit failover protection with re-snapshot¶
Note
Individual change events that occur on the source between dropping the slot and completing the re-snapshot are not delivered as CDC events. They are absorbed into the snapshot’s final row values.
-
In the connector, remove all tables from replication by clearing the Included Table Names and Included Table Regex parameters.
-
Wait until all queues in the connector are empty.
-
Stop the connector, including all Processors and Controller Services.
-
Drop the replication slot. The slot name is in the
CaptureChangePostgreSQLprocessor state underreplication.slot.name, or inpg_replication_slots: -
Install a new connector. In the top menu, drag down Import from registry. Select postgresql from Flow, select Keep existing Parameter contexts to reuse the same parameter context as the existing connector, then click Import.
-
Re-add tables to Included Table Names.
-
Start the new connector fully, including all Processors and Controller Services. The connector creates a new replication slot with
failover=trueand snapshots the tables fresh.
Verify the new slot has failover=true:
Additional step when running pg_ upgrade¶
This step is only needed during a major-version upgrade. It is not part of the general setup.
Ensure the connector is caught up and the slot is not conflicting or invalidated before starting pg_upgrade: