Please add support for new CREATE_REPLICATION_SLOT statement format
In PostgreSQL 15, a new format for the CREATE_REPLICATION_SLOT statement was introduced, supporting arbitrary options. In PostgreSQL 17, a great new option, FAILOVER, was added for synchronizing replication slots between servers.
Support for these changes seems to break backward compatibility, but that would be great. It would also be great if all variants of the CREATE_REPLICATION_SLOT statement from different PostgreSQL versions were supported.
For further discussion, quote the formats from the official doc: https://www.postgresql.org/docs/17/protocol-replication.html#PROTOCOL-REPLICATION-CREATE-REPLICATION-SLOT
Old format
CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [ RESERVE_WAL ] | LOGICAL output_plugin [ EXPORT_SNAPSHOT | NOEXPORT_SNAPSHOT | USE_SNAPSHOT ] }
New format
CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL | LOGICAL output_plugin } [ ( option [, ...] ) ]
I was able to use the new syntax and set FAILOVER to true using the below value for opts.
createSlotOpts := pglogrepl.CreateReplicationSlotOptions{
Temporary: false,
Mode: pglogrepl.LogicalReplication,
SnapshotAction: "(SNAPSHOT 'nothing', FAILOVER TRUE)",
}
While I would still like to see proper support for the new syntax I can live with the workaround for now.