postgres.git / summary / log / commit / refs

commit    c558e1e64db77634893ca062d1e8b8f841d54f56
Author:   Andrew Dunstan <andrew@dunslane.net>
Date:     Mon Sep 02 18:36:08 2013 +0000
First released in: 9.4.0, 8.4.18, 9.0.14, 9.1.10, 9.2.5, 9.3.0

    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.


doc/src/sgml/maintenance.sgml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index adb9498578a..1a5258b9490 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -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> [parent: b8288038baed]