Show record information in pg_get_wal_block_info.
[pgsql.git] / contrib / pg_walinspect / pg_walinspect--1.0--1.1.sql
blobfdd75e8a7298da97d6e999e0539a7d3d69f0be96
1 /* contrib/pg_walinspect/pg_walinspect--1.0--1.1.sql */
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION pg_walinspect UPDATE TO '1.1'" to load this file. \quit
6 -- Unsupported functions after 1.1.
7 DROP FUNCTION pg_get_wal_records_info_till_end_of_wal(pg_lsn);
8 DROP FUNCTION pg_get_wal_stats_till_end_of_wal(pg_lsn, boolean);
11 -- pg_get_wal_block_info()
13 CREATE FUNCTION pg_get_wal_block_info(IN start_lsn pg_lsn,
14         IN end_lsn pg_lsn,
15         OUT start_lsn pg_lsn,
16         OUT end_lsn pg_lsn,
17         OUT prev_lsn pg_lsn,
18         OUT block_id int2,
19         OUT reltablespace oid,
20         OUT reldatabase oid,
21         OUT relfilenode oid,
22         OUT relforknumber int2,
23         OUT relblocknumber int8,
24         OUT xid xid,
25         OUT resource_manager text,
26         OUT record_type text,
27         OUT record_length int4,
28         OUT main_data_length int4,
29         OUT block_data_length int4,
30         OUT block_fpi_length int4,
31         OUT block_fpi_info text[],
32         OUT description text,
33         OUT block_data bytea,
34         OUT block_fpi_data bytea
36 RETURNS SETOF record
37 AS 'MODULE_PATHNAME', 'pg_get_wal_block_info'
38 LANGUAGE C STRICT PARALLEL SAFE;
40 REVOKE EXECUTE ON FUNCTION pg_get_wal_block_info(pg_lsn, pg_lsn) FROM PUBLIC;
41 GRANT EXECUTE ON FUNCTION pg_get_wal_block_info(pg_lsn, pg_lsn) TO pg_read_server_files;