Debian Codegraph @

contrib/pageinspect/pageinspect--1.12--1.13.sql

raw
1 /* contrib/pageinspect/pageinspect--1.12--1.13.sql */
2
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.13'" to load this file. \quit
5
6 -- Convert SQL functions to new style
7
8 CREATE OR REPLACE FUNCTION heap_page_item_attrs(
9 IN page bytea,
10 IN rel_oid regclass,
11 IN do_detoast bool,
12 OUT lp smallint,
13 OUT lp_off smallint,
14 OUT lp_flags smallint,
15 OUT lp_len smallint,
16 OUT t_xmin xid,
17 OUT t_xmax xid,
18 OUT t_field3 int4,
19 OUT t_ctid tid,
20 OUT t_infomask2 integer,
21 OUT t_infomask integer,
22 OUT t_hoff smallint,
23 OUT t_bits text,
24 OUT t_oid oid,
25 OUT t_attrs bytea[]
26 )
27 RETURNS SETOF record
28 LANGUAGE SQL PARALLEL RESTRICTED
29 BEGIN ATOMIC
30 SELECT lp,
31 lp_off,
32 lp_flags,
33 lp_len,
34 t_xmin,
35 t_xmax,
36 t_field3,
37 t_ctid,
38 t_infomask2,
39 t_infomask,
40 t_hoff,
41 t_bits,
42 t_oid,
43 tuple_data_split(
44 rel_oid::oid,
45 t_data,
46 t_infomask,
47 t_infomask2,
48 t_bits,
49 do_detoast)
50 AS t_attrs
51 FROM heap_page_items(page);
52 END;
53
54 CREATE OR REPLACE FUNCTION heap_page_item_attrs(IN page bytea, IN rel_oid regclass,
55 OUT lp smallint,
56 OUT lp_off smallint,
57 OUT lp_flags smallint,
58 OUT lp_len smallint,
59 OUT t_xmin xid,
60 OUT t_xmax xid,
61 OUT t_field3 int4,
62 OUT t_ctid tid,
63 OUT t_infomask2 integer,
64 OUT t_infomask integer,
65 OUT t_hoff smallint,
66 OUT t_bits text,
67 OUT t_oid oid,
68 OUT t_attrs bytea[]
69 )
70 RETURNS SETOF record
71 LANGUAGE SQL PARALLEL RESTRICTED
72 BEGIN ATOMIC
73 SELECT * FROM heap_page_item_attrs(page, rel_oid, false);
74 END;