File: pg_logicalinspect--1.0.sql

package info (click to toggle)
postgresql-18 18~beta3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 155,816 kB
  • sloc: ansic: 993,154; sql: 127,411; perl: 58,874; xml: 30,905; yacc: 21,023; lex: 9,000; makefile: 6,880; sh: 5,353; cpp: 984; python: 710; asm: 40; sed: 3
file content (43 lines) | stat: -rw-r--r-- 1,391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* contrib/pg_logicalinspect/pg_logicalinspect--1.0.sql */

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_logicalinspect" to load this file. \quit

--
-- pg_get_logical_snapshot_meta()
--
CREATE FUNCTION pg_get_logical_snapshot_meta(IN filename text,
    OUT magic int4,
    OUT checksum int8,
    OUT version int4
)
AS 'MODULE_PATHNAME', 'pg_get_logical_snapshot_meta'
LANGUAGE C STRICT PARALLEL SAFE;

REVOKE EXECUTE ON FUNCTION pg_get_logical_snapshot_meta(text) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION pg_get_logical_snapshot_meta(text) TO pg_read_server_files;

--
-- pg_get_logical_snapshot_info()
--
CREATE FUNCTION pg_get_logical_snapshot_info(IN filename text,
    OUT state text,
    OUT xmin xid,
    OUT xmax xid,
    OUT start_decoding_at pg_lsn,
    OUT two_phase_at pg_lsn,
    OUT initial_xmin_horizon xid,
    OUT building_full_snapshot boolean,
    OUT in_slot_creation boolean,
    OUT last_serialized_snapshot pg_lsn,
    OUT next_phase_at xid,
    OUT committed_count int4,
    OUT committed_xip xid[],
    OUT catchange_count int4,
    OUT catchange_xip xid[]
)
AS 'MODULE_PATHNAME', 'pg_get_logical_snapshot_info'
LANGUAGE C STRICT PARALLEL SAFE;

REVOKE EXECUTE ON FUNCTION pg_get_logical_snapshot_info(text) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION pg_get_logical_snapshot_info(text) TO pg_read_server_files;