Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite472ce9

Browse files
committed
Add integrity-checking functions to pg_visibility.
The new pg_check_visible() and pg_check_frozen() functions can be used toverify that the visibility map bits for a relation's data pages match theactual state of the tuples on those pages.Amit Kapila and Robert Haas, reviewed (in earlier versions) by AndresFreund. Additional testing help by Thomas Munro.
1 parent38e9f90 commite472ce9

File tree

7 files changed

+376
-4
lines changed

7 files changed

+376
-4
lines changed

‎contrib/pg_visibility/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MODULE_big = pg_visibility
44
OBJS = pg_visibility.o$(WIN32RES)
55

66
EXTENSION = pg_visibility
7-
DATA = pg_visibility--1.0.sql
7+
DATA = pg_visibility--1.1.sql pg_visibility--1.0--1.1.sql
88
PGFILEDESC = "pg_visibility - page visibility information"
99

1010
ifdefUSE_PGXS
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* contrib/pg_visibility/pg_visibility--1.0--1.1.sql*/
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use"ALTER EXTENSION pg_visibility UPDATE TO '1.1'" to load this file. \quit
5+
6+
CREATEFUNCTIONpg_check_frozen(regclass, t_ctid OUT tid)
7+
RETURNS SETOF tid
8+
AS'MODULE_PATHNAME','pg_check_frozen'
9+
LANGUAGE C STRICT;
10+
11+
CREATEFUNCTIONpg_check_visible(regclass, t_ctid OUT tid)
12+
RETURNS SETOF tid
13+
AS'MODULE_PATHNAME','pg_check_visible'
14+
LANGUAGE C STRICT;
15+
16+
REVOKE ALLON FUNCTION pg_check_frozen(regclass)FROM PUBLIC;
17+
REVOKE ALLON FUNCTION pg_check_visible(regclass)FROM PUBLIC;

‎contrib/pg_visibility/pg_visibility--1.0.sqlrenamed to‎contrib/pg_visibility/pg_visibility--1.1.sql

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/pg_visibility/pg_visibility--1.0.sql*/
1+
/* contrib/pg_visibility/pg_visibility--1.1.sql*/
22

33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use"CREATE EXTENSION pg_visibility" to load this file. \quit
@@ -44,9 +44,24 @@ RETURNS record
4444
AS'MODULE_PATHNAME','pg_visibility_map_summary'
4545
LANGUAGE C STRICT;
4646

47+
-- Show tupleids of non-frozen tuples if any in all_frozen pages
48+
-- for a relation.
49+
CREATEFUNCTIONpg_check_frozen(regclass, t_ctid OUT tid)
50+
RETURNS SETOF tid
51+
AS'MODULE_PATHNAME','pg_check_frozen'
52+
LANGUAGE C STRICT;
53+
54+
-- Show tupleids of dead tuples if any in all_visible pages for a relation.
55+
CREATEFUNCTIONpg_check_visible(regclass, t_ctid OUT tid)
56+
RETURNS SETOF tid
57+
AS'MODULE_PATHNAME','pg_check_visible'
58+
LANGUAGE C STRICT;
59+
4760
-- Don't want these to be available to public.
4861
REVOKE ALLON FUNCTION pg_visibility_map(regclass,bigint)FROM PUBLIC;
4962
REVOKE ALLON FUNCTION pg_visibility(regclass,bigint)FROM PUBLIC;
5063
REVOKE ALLON FUNCTION pg_visibility_map(regclass)FROM PUBLIC;
5164
REVOKE ALLON FUNCTION pg_visibility(regclass)FROM PUBLIC;
5265
REVOKE ALLON FUNCTION pg_visibility_map_summary(regclass)FROM PUBLIC;
66+
REVOKE ALLON FUNCTION pg_check_frozen(regclass)FROM PUBLIC;
67+
REVOKE ALLON FUNCTION pg_check_visible(regclass)FROM PUBLIC;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp