mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
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.
This commit is contained in:
@ -492,7 +492,12 @@
|
||||
examine this information is to execute queries such as:
|
||||
|
||||
<programlisting>
|
||||
SELECT relname, age(relfrozenxid) FROM pg_class WHERE relkind = 'r';
|
||||
SELECT c.oid::regclass as table_name,
|
||||
greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as age
|
||||
FROM pg_class c
|
||||
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
|
||||
WHERE c.relkind = 'r';
|
||||
|
||||
SELECT datname, age(datfrozenxid) FROM pg_database;
|
||||
</programlisting>
|
||||
|
||||
|
Reference in New Issue
Block a user