Skip to content

Commit f002dc3

Browse files
committed
Fix relfrozenxid query in docs to include TOAST tables.
The original query ignored TOAST tables which could result in tables needing a vacuum not being reported. Backpatch to all live branches.
1 parent 6a007fa commit f002dc3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,12 @@
534534
examine this information is to execute queries such as:
535535

536536
<programlisting>
537-
SELECT relname, age(relfrozenxid) FROM pg_class WHERE relkind IN ('r', 'm');
537+
SELECT c.oid::regclass as table_name,
538+
greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as age
539+
FROM pg_class c
540+
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
541+
WHERE c.relkind IN ('r', 'm');
542+
538543
SELECT datname, age(datfrozenxid) FROM pg_database;
539544
</programlisting>
540545

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy