Add to pageinspect function to make t_infomask/t_infomask2 human-readable
Flags of t_infomask and t_infomask2 for each tuple are already included
in the information returned by heap_page_items as integers, and we
lacked a way to make that information human-readable.
Per discussion, the function includes an option which controls if
combined flags should be decomposed or not. The default is false, to
not decompose combined flags.
The module is bumped to version 1.8.
Author: Craig Ringer, Sawada Masahiko
Reviewed-by: Peter Geoghegan, Robert Haas, Álvaro Herrera, Moon Insung,
Amit Kapila, Michael Paquier, Tomas Vondra
Discussion: https://postgr.es/m/CAMsr+YEY7jeaXOb+oX+RhDyOFuTMdmHjGsBxL=igCm03J0go9Q@mail.gmail.com
2019-09-12 14:06:00 +08:00
|
|
|
/* contrib/pageinspect/pageinspect--1.7--1.8.sql */
|
|
|
|
|
|
|
|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
|
|
|
|
\echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.8'" to load this file. \quit
|
|
|
|
|
|
|
|
--
|
|
|
|
-- heap_tuple_infomask_flags()
|
|
|
|
--
|
|
|
|
CREATE FUNCTION heap_tuple_infomask_flags(
|
|
|
|
t_infomask integer,
|
|
|
|
t_infomask2 integer,
|
2019-09-19 10:01:52 +08:00
|
|
|
raw_flags OUT text[],
|
|
|
|
combined_flags OUT text[])
|
|
|
|
RETURNS record
|
Add to pageinspect function to make t_infomask/t_infomask2 human-readable
Flags of t_infomask and t_infomask2 for each tuple are already included
in the information returned by heap_page_items as integers, and we
lacked a way to make that information human-readable.
Per discussion, the function includes an option which controls if
combined flags should be decomposed or not. The default is false, to
not decompose combined flags.
The module is bumped to version 1.8.
Author: Craig Ringer, Sawada Masahiko
Reviewed-by: Peter Geoghegan, Robert Haas, Álvaro Herrera, Moon Insung,
Amit Kapila, Michael Paquier, Tomas Vondra
Discussion: https://postgr.es/m/CAMsr+YEY7jeaXOb+oX+RhDyOFuTMdmHjGsBxL=igCm03J0go9Q@mail.gmail.com
2019-09-12 14:06:00 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'heap_tuple_infomask_flags'
|
|
|
|
LANGUAGE C STRICT PARALLEL SAFE;
|
2020-03-01 04:10:17 +08:00
|
|
|
|
|
|
|
--
|
|
|
|
-- bt_metap()
|
|
|
|
--
|
|
|
|
DROP FUNCTION bt_metap(text);
|
|
|
|
CREATE FUNCTION bt_metap(IN relname text,
|
|
|
|
OUT magic int4,
|
|
|
|
OUT version int4,
|
2020-03-08 08:44:53 +08:00
|
|
|
OUT root int8,
|
|
|
|
OUT level int8,
|
|
|
|
OUT fastroot int8,
|
|
|
|
OUT fastlevel int8,
|
|
|
|
OUT oldest_xact xid,
|
|
|
|
OUT last_cleanup_num_tuples float8,
|
2020-03-01 04:10:17 +08:00
|
|
|
OUT allequalimage boolean)
|
|
|
|
AS 'MODULE_PATHNAME', 'bt_metap'
|
|
|
|
LANGUAGE C STRICT PARALLEL SAFE;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- bt_page_items(text, int4)
|
|
|
|
--
|
|
|
|
DROP FUNCTION bt_page_items(text, int4);
|
|
|
|
CREATE FUNCTION bt_page_items(IN relname text, IN blkno int4,
|
|
|
|
OUT itemoffset smallint,
|
|
|
|
OUT ctid tid,
|
|
|
|
OUT itemlen smallint,
|
|
|
|
OUT nulls bool,
|
|
|
|
OUT vars bool,
|
|
|
|
OUT data text,
|
|
|
|
OUT dead boolean,
|
|
|
|
OUT htid tid,
|
|
|
|
OUT tids tid[])
|
|
|
|
RETURNS SETOF record
|
|
|
|
AS 'MODULE_PATHNAME', 'bt_page_items'
|
|
|
|
LANGUAGE C STRICT PARALLEL SAFE;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- bt_page_items(bytea)
|
|
|
|
--
|
|
|
|
DROP FUNCTION bt_page_items(bytea);
|
|
|
|
CREATE FUNCTION bt_page_items(IN page bytea,
|
|
|
|
OUT itemoffset smallint,
|
|
|
|
OUT ctid tid,
|
|
|
|
OUT itemlen smallint,
|
|
|
|
OUT nulls bool,
|
|
|
|
OUT vars bool,
|
|
|
|
OUT data text,
|
|
|
|
OUT dead boolean,
|
|
|
|
OUT htid tid,
|
|
|
|
OUT tids tid[])
|
|
|
|
RETURNS SETOF record
|
|
|
|
AS 'MODULE_PATHNAME', 'bt_page_items_bytea'
|
|
|
|
LANGUAGE C STRICT PARALLEL SAFE;
|