Wraparaund

VACUUM FROZEN

SELECT oid, datname, age(datfrozenxid), mxid_age(datminmxid)
FROM pg_database ORDER BY age(datfrozenxid) DESC

Проверка max transaction id

SELECT
    c.relnamespace::regnamespace as schema_name, c.relname as table_name,
  greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as age,
  2^31-1000000-greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as remaining
FROM pg_class c LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
WHERE c.relkind IN ('r', 'm') -- and c.relnamespace=2200
ORDER BY 4;
SELECT c.oid::regclass as table_name,
greatest(age(c.relfrozenxid),age(t.relfrozenxid)) as age,
mxid_age(c.relminmxid), *
FROM pg_class c
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
WHERE c.relkind IN 	('r', 'm') and c.relnamespace=2200 order by age desc;