postgresql/contrib/pg_visibility/pg_visibility--1.0--1.1.sql
Robert Haas e472ce9624 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.
2016-06-15 14:33:58 -04:00

18 lines
614 B
SQL

/* contrib/pg_visibility/pg_visibility--1.0--1.1.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pg_visibility UPDATE TO '1.1'" to load this file. \quit
CREATE FUNCTION pg_check_frozen(regclass, t_ctid OUT tid)
RETURNS SETOF tid
AS 'MODULE_PATHNAME', 'pg_check_frozen'
LANGUAGE C STRICT;
CREATE FUNCTION pg_check_visible(regclass, t_ctid OUT tid)
RETURNS SETOF tid
AS 'MODULE_PATHNAME', 'pg_check_visible'
LANGUAGE C STRICT;
REVOKE ALL ON FUNCTION pg_check_frozen(regclass) FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_check_visible(regclass) FROM PUBLIC;