0002-Correction-in-logical-failover-document-sta-20250708.patch

text/x-patch

Filename: 0002-Correction-in-logical-failover-document-sta-20250708.patch
Type: text/x-patch
Part: 1
Message: Re: Using failover slots for PG-non_PG logical replication

Patch

Format: format-patch
Series: patch 0002
Subject: Correction in logical failover document standby query
File+
doc/src/sgml/logical-replication.sgml 1 1
From 5b541b0abb182ce029073ce4a2398bba96e7c3d5 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: Tue, 8 Jul 2025 19:17:44 +0530
Subject: [PATCH 2/2] Correction in logical failover document standby query

The logical failover documenation mentions a query to be run on the
standby to make sure that all the failover replication slots have been
synced. That query may report failover_ready as true for an invalidated
replication slot if the replication slot didn't conflict with recovery.
Fix the query to check NULL invalidation_reason instead of conflicting
column.

Author: Shveta Malik
Reviewed by: Ashutosh Bapat
Discussion: https://www.postgresql.org/message-id/CAJpy0uCNfu=T_L4O56xqED0fAutuuG7nYquOQHPFganSuGtagA@mail.gmail.com
---
 doc/src/sgml/logical-replication.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 7b3558ff248..e26f7f59d4a 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -764,7 +764,7 @@ HINT:  To initiate replication, you must manually create the replication slot, e
      Check that the logical replication slots identified above exist on
      the standby server and are ready for failover.
 <programlisting>
-/* standby # */ SELECT slot_name, (synced AND NOT temporary AND NOT conflicting) AS failover_ready
+/* standby # */ SELECT slot_name, (synced AND NOT temporary AND invalidation_reason IS NULL) AS failover_ready
                FROM pg_replication_slots
                WHERE slot_name IN
                    ('sub1','sub2','sub3', 'pg_16394_sync_16385_7394666715149055164');
-- 
2.34.1