mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
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.
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user