pg_amcheck: Fix test failure on Windows with non-existing role
[pgsql.git] / contrib / pg_walinspect / pg_walinspect--1.0.sql
blob08b3dd55567bc2d25da65e98911f51014188f0db
1 /* contrib/pg_walinspect/pg_walinspect--1.0.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION pg_walinspect" to load this file. \quit
6 --
7 -- pg_get_wal_record_info()
8 --
9 CREATE FUNCTION pg_get_wal_record_info(IN in_lsn pg_lsn,
10     OUT start_lsn pg_lsn,
11     OUT end_lsn pg_lsn,
12     OUT prev_lsn pg_lsn,
13     OUT xid xid,
14     OUT resource_manager text,
15     OUT record_type text,
16     OUT record_length int4,
17     OUT main_data_length int4,
18     OUT fpi_length int4,
19     OUT description text,
20     OUT block_ref text
22 AS 'MODULE_PATHNAME', 'pg_get_wal_record_info'
23 LANGUAGE C STRICT PARALLEL SAFE;
25 REVOKE EXECUTE ON FUNCTION pg_get_wal_record_info(pg_lsn) FROM PUBLIC;
26 GRANT EXECUTE ON FUNCTION pg_get_wal_record_info(pg_lsn) TO pg_read_server_files;
29 -- pg_get_wal_records_info()
31 CREATE FUNCTION pg_get_wal_records_info(IN start_lsn pg_lsn,
32     IN end_lsn pg_lsn,
33     OUT start_lsn pg_lsn,
34     OUT end_lsn pg_lsn,
35     OUT prev_lsn pg_lsn,
36     OUT xid xid,
37     OUT resource_manager text,
38     OUT record_type text,
39     OUT record_length int4,
40     OUT main_data_length int4,
41     OUT fpi_length int4,
42     OUT description text,
43     OUT block_ref text
45 RETURNS SETOF record
46 AS 'MODULE_PATHNAME', 'pg_get_wal_records_info'
47 LANGUAGE C STRICT PARALLEL SAFE;
49 REVOKE EXECUTE ON FUNCTION pg_get_wal_records_info(pg_lsn, pg_lsn) FROM PUBLIC;
50 GRANT EXECUTE ON FUNCTION pg_get_wal_records_info(pg_lsn, pg_lsn) TO pg_read_server_files;
53 -- pg_get_wal_records_info_till_end_of_wal()
55 CREATE FUNCTION pg_get_wal_records_info_till_end_of_wal(IN start_lsn pg_lsn,
56     OUT start_lsn pg_lsn,
57     OUT end_lsn pg_lsn,
58     OUT prev_lsn pg_lsn,
59     OUT xid xid,
60     OUT resource_manager text,
61     OUT record_type text,
62     OUT record_length int4,
63     OUT main_data_length int4,
64     OUT fpi_length int4,
65     OUT description text,
66     OUT block_ref text
68 RETURNS SETOF record
69 AS 'MODULE_PATHNAME', 'pg_get_wal_records_info_till_end_of_wal'
70 LANGUAGE C STRICT PARALLEL SAFE;
72 REVOKE EXECUTE ON FUNCTION pg_get_wal_records_info_till_end_of_wal(pg_lsn) FROM PUBLIC;
73 GRANT EXECUTE ON FUNCTION pg_get_wal_records_info_till_end_of_wal(pg_lsn) TO pg_read_server_files;
76 -- pg_get_wal_stats()
78 CREATE FUNCTION pg_get_wal_stats(IN start_lsn pg_lsn,
79     IN end_lsn pg_lsn,
80     IN  per_record boolean DEFAULT false,
81     OUT "resource_manager/record_type" text,
82     OUT count int8,
83     OUT count_percentage float8,
84     OUT record_size int8,
85     OUT record_size_percentage float8,
86     OUT fpi_size int8,
87     OUT fpi_size_percentage float8,
88     OUT combined_size int8,
89     OUT combined_size_percentage float8
91 RETURNS SETOF record
92 AS 'MODULE_PATHNAME', 'pg_get_wal_stats'
93 LANGUAGE C STRICT PARALLEL SAFE;
95 REVOKE EXECUTE ON FUNCTION pg_get_wal_stats(pg_lsn, pg_lsn, boolean) FROM PUBLIC;
96 GRANT EXECUTE ON FUNCTION pg_get_wal_stats(pg_lsn, pg_lsn, boolean) TO pg_read_server_files;
99 -- pg_get_wal_stats_till_end_of_wal()
101 CREATE FUNCTION pg_get_wal_stats_till_end_of_wal(IN start_lsn pg_lsn,
102     IN  per_record boolean DEFAULT false,
103     OUT "resource_manager/record_type" text,
104     OUT count int8,
105     OUT count_percentage float8,
106     OUT record_size int8,
107     OUT record_size_percentage float8,
108     OUT fpi_size int8,
109     OUT fpi_size_percentage float8,
110     OUT combined_size int8,
111     OUT combined_size_percentage float8
113 RETURNS SETOF record
114 AS 'MODULE_PATHNAME', 'pg_get_wal_stats_till_end_of_wal'
115 LANGUAGE C STRICT PARALLEL SAFE;
117 REVOKE EXECUTE ON FUNCTION pg_get_wal_stats_till_end_of_wal(pg_lsn, boolean) FROM PUBLIC;
118 GRANT EXECUTE ON FUNCTION pg_get_wal_stats_till_end_of_wal(pg_lsn, boolean) TO pg_read_server_files;