diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-06-15 14:33:58 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-06-15 14:33:58 -0400 |
commit | e472ce9624e0f2083c8fd25ea1acb081be908f8f (patch) | |
tree | 3b72ed0481ab470b40b0ec8a84450665559fdd94 /doc/src | |
parent | 38e9f90a227d1e60e7b4691d1a71fefaba6059e5 (diff) |
Add integrity-checking functions to pg_visibility.
The new pg_check_visible() and pg_check_frozen() functions can be used to
verify that the visibility map bits for a relation's data pages match the
actual state of the tuples on those pages.
Amit Kapila and Robert Haas, reviewed (in earlier versions) by Andres
Freund. Additional testing help by Thomas Munro.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/pgvisibility.sgml | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/src/sgml/pgvisibility.sgml b/doc/src/sgml/pgvisibility.sgml index 48b003d1516..4cdca7dada9 100644 --- a/doc/src/sgml/pgvisibility.sgml +++ b/doc/src/sgml/pgvisibility.sgml @@ -32,7 +32,8 @@ Functions which display information about <literal>PD_ALL_VISIBLE</> are much more costly than those which only consult the visibility map, because they must read the relation's data blocks rather than only the - (much smaller) visibility map. + (much smaller) visibility map. Functions that check the relation's + data blocks are similarly expensive. </para> <sect2> @@ -92,6 +93,31 @@ </para> </listitem> </varlistentry> + + <varlistentry> + <term><function>pg_check_frozen(regclass, t_ctid OUT tid) returns setof tid</function></term> + + <listitem> + <para> + Returns the TIDs of non-frozen tuples present in pages marked all-frozen + in the visibility map. If this function returns a non-empty set of + TIDs, the database is corrupt. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><function>pg_check_visible(regclass, t_ctid OUT tid) returns setof tid</function></term> + + <listitem> + <para> + Returns the TIDs of tuples which are not all-visible despite the fact + that the pages which contain them are marked as all-visible in the + visibility map. If this function returns a non-empty set of TIDs, the + database is corrupt. + </para> + </listitem> + </varlistentry> </variablelist> <para> |