2 F.28. pg_logicalinspect — logical decoding components inspection #
7 The pg_logicalinspect module provides SQL functions that allow you to
8 inspect the contents of logical decoding components. It allows the
9 inspection of serialized logical snapshots of a running PostgreSQL
10 database cluster, which is useful for debugging or educational
13 By default, use of these functions is restricted to superusers and
14 members of the pg_read_server_files role. Access may be granted by
15 superusers to others using GRANT.
19 pg_get_logical_snapshot_meta(filename text) returns record #
20 Gets logical snapshot metadata about a snapshot file that is
21 located in the server's pg_logical/snapshots directory. The
22 filename argument represents the snapshot file name. For
25 postgres=# SELECT * FROM pg_ls_logicalsnapdir();
26 -[ RECORD 1 ]+-----------------------
27 name | 0-40796E18.snap
29 modification | 2024-08-14 16:36:32+00
31 postgres=# SELECT * FROM pg_get_logical_snapshot_meta('0-40796E18.snap');
37 postgres=# SELECT ss.name, meta.* FROM pg_ls_logicalsnapdir() AS ss,
38 pg_get_logical_snapshot_meta(ss.name) AS meta;
39 -[ RECORD 1 ]-------------
40 name | 0-40796E18.snap
45 If filename does not match a snapshot file, the function raises
48 pg_get_logical_snapshot_info(filename text) returns record #
49 Gets logical snapshot information about a snapshot file that is
50 located in the server's pg_logical/snapshots directory. The
51 filename argument represents the snapshot file name. For
54 postgres=# SELECT * FROM pg_ls_logicalsnapdir();
55 -[ RECORD 1 ]+-----------------------
56 name | 0-40796E18.snap
58 modification | 2024-08-14 16:36:32+00
60 postgres=# SELECT * FROM pg_get_logical_snapshot_info('0-40796E18.snap');
61 -[ RECORD 1 ]------------+-----------
65 start_decoding_at | 0/40796AF8
66 two_phase_at | 0/40796AF8
67 initial_xmin_horizon | 0
68 building_full_snapshot | f
70 last_serialized_snapshot | 0/0
75 catchange_xip | {751,752}
77 postgres=# SELECT ss.name, info.* FROM pg_ls_logicalsnapdir() AS ss,
78 pg_get_logical_snapshot_info(ss.name) AS info;
79 -[ RECORD 1 ]------------+----------------
80 name | 0-40796E18.snap
84 start_decoding_at | 0/40796AF8
85 two_phase_at | 0/40796AF8
86 initial_xmin_horizon | 0
87 building_full_snapshot | f
89 last_serialized_snapshot | 0/0
94 catchange_xip | {751,752}
96 If filename does not match a snapshot file, the function raises
101 Bertrand Drouvot <bertranddrouvot.pg@gmail.com>