From 94d9288cafe18530c32d53baf69a7d6c50333516 Mon Sep 17 00:00:00 2001
From: Joao Foltran <joao@foltrandba.com>
Date: Thu, 26 Mar 2026 16:08:58 -0300
Subject: [PATCH v3 5/5] Add documentation for auto_revalidate Document the
 auto_revalidate column in pg_replication_slots view (system-views.sgml) and
 the new optional parameter in pg_create_physical_replication_slot
 (func-admin.sgml).

---
 doc/src/sgml/func/func-admin.sgml |  8 ++++++--
 doc/src/sgml/system-views.sgml    | 11 +++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/func/func-admin.sgml b/doc/src/sgml/func/func-admin.sgml
index 0eae1c1f616..0b76c83e162 100644
--- a/doc/src/sgml/func/func-admin.sgml
+++ b/doc/src/sgml/func/func-admin.sgml
@@ -1032,7 +1032,7 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
         <indexterm>
          <primary>pg_create_physical_replication_slot</primary>
         </indexterm>
-        <function>pg_create_physical_replication_slot</function> ( <parameter>slot_name</parameter> <type>name</type> <optional>, <parameter>immediately_reserve</parameter> <type>boolean</type>, <parameter>temporary</parameter> <type>boolean</type> </optional> )
+        <function>pg_create_physical_replication_slot</function> ( <parameter>slot_name</parameter> <type>name</type> <optional>, <parameter>immediately_reserve</parameter> <type>boolean</type>, <parameter>temporary</parameter> <type>boolean</type>, <parameter>auto_revalidate</parameter> <type>boolean</type> </optional> )
         <returnvalue>record</returnvalue>
         ( <parameter>slot_name</parameter> <type>name</type>,
         <parameter>lsn</parameter> <type>pg_lsn</type> )
@@ -1051,7 +1051,11 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
         parameter, <parameter>temporary</parameter>, when set to true, specifies that
         the slot should not be permanently stored to disk and is only meant
         for use by the current session. Temporary slots are also
-        released upon any error. This function corresponds
+        released upon any error. The optional fourth parameter,
+        <parameter>auto_revalidate</parameter>, when set to true, specifies
+        that the slot may be automatically revalidated after invalidation
+        once the standby reconnects and confirms WAL receipt.
+        This function corresponds
         to the replication protocol command <literal>CREATE_REPLICATION_SLOT
         ... PHYSICAL</literal>.
        </para></entry>
diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml
index 2ebec6928d5..db5282c0e91 100644
--- a/doc/src/sgml/system-views.sgml
+++ b/doc/src/sgml/system-views.sgml
@@ -3131,6 +3131,17 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
       </para></entry>
      </row>
 
+     <row>
+      <entry role="catalog_table_entry"><para role="column_definition">
+       <structfield>auto_revalidate</structfield> <type>bool</type>
+      </para>
+      <para>
+       True if this physical slot is eligible for automatic revalidation
+       after invalidation, once the standby reconnects and confirms WAL
+       receipt.  Always false for logical slots.
+      </para></entry>
+     </row>
+
      <row>
       <entry role="catalog_table_entry"><para role="column_definition">
        <structfield>slotsync_skip_reason</structfield><type>text</type>
-- 
2.50.1 (Apple Git-155)

