pg_copy_logical_replication_slot doesn't copy the failover property

The Post Office <noreply@postgresql.org>

From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: duffieldzane@gmail.com
Date: 2025-02-17T05:01:48Z
Lists: pgsql-hackers, pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/functions-admin.html
Description:

The documentation for pg_copy_logical_replication_slot doesn't mention that
the failover property for the logical slot is not copied.

I assumed there was a good reason for this, and I found a comment in the
source code that explains it (although I don't really understand).
It says
		 * To avoid potential issues with the slot synchronization where the
		 * restart_lsn of a replication slot can go backward, we set the
		 * failover option to false here.  This situation occurs when a slot
		 * on the primary server is dropped and immediately replaced with a
		 * new slot of the same name, created by copying from another existing
		 * slot.  However, the slot synchronization will only observe the
		 * restart_lsn of the same slot going backward.

I assumed that by default, all properties from the original slot would be
copied, so this function left me wondering why my logical replication slots
were not being synced to the replica.

Commits

  1. Doc: Fix pg_copy_logical_replication_slot description.

  2. Add option to enable two_phase commits via pg_create_logical_replication_slot.