Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0271e27

Browse files
committed
Add forgotten file in commit d6061f8
1 parent d6061f8 commit 0271e27

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/* contrib/pageinspect/pageinspect--1.3--1.4.sql */
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.4'" to load this file. \quit
5+
6+
--
7+
-- heap_page_items()
8+
--
9+
DROP FUNCTION heap_page_items(bytea);
10+
CREATE FUNCTION heap_page_items(IN page bytea,
11+
OUT lp smallint,
12+
OUT lp_off smallint,
13+
OUT lp_flags smallint,
14+
OUT lp_len smallint,
15+
OUT t_xmin xid,
16+
OUT t_xmax xid,
17+
OUT t_field3 int4,
18+
OUT t_ctid tid,
19+
OUT t_infomask2 integer,
20+
OUT t_infomask integer,
21+
OUT t_hoff smallint,
22+
OUT t_bits text,
23+
OUT t_oid oid,
24+
OUT t_data bytea)
25+
RETURNS SETOF record
26+
AS 'MODULE_PATHNAME', 'heap_page_items'
27+
LANGUAGE C STRICT;
28+
29+
--
30+
-- tuple_data_split()
31+
--
32+
CREATE FUNCTION tuple_data_split(rel_oid oid,
33+
t_data bytea,
34+
t_infomask integer,
35+
t_infomask2 integer,
36+
t_bits text)
37+
RETURNS bytea[]
38+
AS 'MODULE_PATHNAME','tuple_data_split'
39+
LANGUAGE C;
40+
41+
CREATE FUNCTION tuple_data_split(rel_oid oid,
42+
t_data bytea,
43+
t_infomask integer,
44+
t_infomask2 integer,
45+
t_bits text,
46+
do_detoast bool)
47+
RETURNS bytea[]
48+
AS 'MODULE_PATHNAME','tuple_data_split'
49+
LANGUAGE C;
50+
51+
--
52+
-- heap_page_item_attrs()
53+
--
54+
CREATE FUNCTION heap_page_item_attrs(
55+
IN page bytea,
56+
IN rel_oid regclass,
57+
IN do_detoast bool,
58+
OUT lp smallint,
59+
OUT lp_off smallint,
60+
OUT lp_flags smallint,
61+
OUT lp_len smallint,
62+
OUT t_xmin xid,
63+
OUT t_xmax xid,
64+
OUT t_field3 int4,
65+
OUT t_ctid tid,
66+
OUT t_infomask2 integer,
67+
OUT t_infomask integer,
68+
OUT t_hoff smallint,
69+
OUT t_bits text,
70+
OUT t_oid oid,
71+
OUT t_attrs bytea[]
72+
)
73+
RETURNS SETOF record AS $$
74+
SELECT lp,
75+
lp_off,
76+
lp_flags,
77+
lp_len,
78+
t_xmin,
79+
t_xmax,
80+
t_field3,
81+
t_ctid,
82+
t_infomask2,
83+
t_infomask,
84+
t_hoff,
85+
t_bits,
86+
t_oid,
87+
tuple_data_split(
88+
rel_oid,
89+
t_data,
90+
t_infomask,
91+
t_infomask2,
92+
t_bits,
93+
do_detoast)
94+
AS t_attrs
95+
FROM heap_page_items(page);
96+
$$ LANGUAGE SQL;
97+
98+
CREATE FUNCTION heap_page_item_attrs(
99+
IN page bytea,
100+
IN rel_oid regclass,
101+
OUT lp smallint,
102+
OUT lp_off smallint,
103+
OUT lp_flags smallint,
104+
OUT lp_len smallint,
105+
OUT t_xmin xid,
106+
OUT t_xmax xid,
107+
OUT t_field3 int4,
108+
OUT t_ctid tid,
109+
OUT t_infomask2 integer,
110+
OUT t_infomask integer,
111+
OUT t_hoff smallint,
112+
OUT t_bits text,
113+
OUT t_oid oid,
114+
OUT t_attrs bytea[]
115+
)
116+
RETURNS SETOF record AS $$
117+
SELECT * from heap_page_item_attrs(page, rel_oid, false);
118+
$$ LANGUAGE SQL;

0 commit comments

Comments
 (0)