Subject: Doubt on content under Routine Vacuuming section

From: PG Doc comments form <[email-masked]>
Date: Tue, 06 Jan 2026 04:11:20 +0000

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/routine-vacuuming.html
Description:

Hi All,
Doc ref:
https://www.postgresql.org/docs/current/routine-vacuuming.html#ROUTINE-VACUUMING
There are five points under this section;
 "In this condition any transactions already in progress can continue, but
only read-only transactions can be started. Operations that modify database
records or truncate relations will fail. The VACUUM command can still be run
normally. Note that, contrary to what was sometimes recommended in earlier
releases, it is not necessary or desirable to stop the postmaster or enter
single user-mode in order to restore normal operation. Instead, follow these
steps:..."

In the third point it says "Use pg_stat_replication to find slots where
age(xmin) or age(catalog_xmin) is large. In many cases, such slots were
created for replication to servers that no longer exist, or that have been
down for a long time."
However, those columns, ie: xmin and catalog_xmin exists in
pg_replication_slots metadata view. :
https://www.postgresql.org/docs/18/view-pg-replication-slots.html
Not in the pg_stat_replication.

Please check if my observation is correct or not.

Thanks.

---

From: Laurenz Albe <[email-masked]>
Date: Tue, 06 Jan 2026 10:53:34 +0100

> Please check if my observation is correct or not.

You are correct.  Attached is a patch that fixes the documentation.

Yours,
Laurenz Albe
From 0914d40caa56ca1a216c206ded5507b26e0b40d5 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <[email-masked]>
Date: Tue, 6 Jan 2026 10:51:30 +0100
Subject: [PATCH v1] Fix doc for recovering from approaching xid wraparound

Commit a70bce43fb added instructions how to recover if PostgreSQL refuses
to issue new transaction IDs because of imminent wraparound, but referred
to pg_stat_replication where it should have referenced pg_replication_slots.

In passing, decorate references to views with <structname> tags.

Author: Laurenz Albe <[email-masked]>
Reported-By: Sanjaya Waruna <[email-masked]>
Discussion: https://postgr.es/m/[email-masked]
---
 doc/src/sgml/maintenance.sgml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 08e6489afb8..50c72eb30c3 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -701,20 +701,20 @@ HINT:  Execute a database-wide VACUUM in that database.
     <orderedlist>
      <listitem>
       <simpara>Resolve old prepared transactions. You can find these by checking
-       <link linkend="view-pg-prepared-xacts">pg_prepared_xacts</link> for rows where
+       <link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link> for rows where
        <literal>age(transactionid)</literal> is large. Such transactions should be
        committed or rolled back.</simpara>
      </listitem>
      <listitem>
       <simpara>End long-running open transactions. You can find these by checking
-       <link linkend="monitoring-pg-stat-activity-view">pg_stat_activity</link> for rows where
+       <link linkend="monitoring-pg-stat-activity-view"><structname>pg_stat_activity</structname></link> for rows where
        <literal>age(backend_xid)</literal> or <literal>age(backend_xmin)</literal> is
        large. Such transactions should be committed or rolled back, or the session
        can be terminated using <literal>pg_terminate_backend</literal>.</simpara>
      </listitem>
      <listitem>
       <simpara>Drop any old replication slots. Use
-       <link linkend="monitoring-pg-stat-replication-view">pg_stat_replication</link> to
+       <link linkend="view-pg-replication-slots"><structname>pg_replication_slots</structname></link> to
        find slots where <literal>age(xmin)</literal> or <literal>age(catalog_xmin)</literal>
        is large. In many cases, such slots were created for replication to servers that no
        longer exist, or that have been down for a long time. If you drop a slot for a server
-- 
2.52.0

---

From: Robert Treat <[email-masked]>
Date: Wed, 7 Jan 2026 23:36:07 -0500

> You are correct.  Attached is a patch that fixes the documentation.

+1 on the fix, and the adding of the structname's.

Given the commit that introduced this was backpatched to v14, ISTM
this should probably be backpatched as well.

Robert Treat
https://xzilla.net

---

From: Fujii Masao <[email-masked]>
Date: Thu, 11 Jun 2026 23:28:53 +0900

> +1 on the fix, and the adding of the structname's.

LGTM.

> this should probably be backpatched as well.

Barring any objections, I will commit the patch and backpatch it to v14.

Regards,

-- 
Fujii Masao

---

From: Fujii Masao <[email-masked]>
Date: Fri, 12 Jun 2026 11:14:35 +0900

> Barring any objections, I will commit the patch and backpatch it to v14.

I've pushed the patch. Thanks!

Regards,

-- 
Fujii Masao