Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Request a Demo
F.28. pg_logicalinspect — logical decoding components inspection
Prev UpAppendix F. Additional Supplied Modules and ExtensionsHome Next

F.28. pg_logicalinspect — logical decoding components inspection#

Thepg_logicalinspect module provides SQL functions that allow you to inspect the contents of logical decoding components. It allows the inspection of serialized logical snapshots of a runningPostgreSQL database cluster, which is useful for debugging or educational purposes.

By default, use of these functions is restricted to superusers and members of thepg_read_server_files role. Access may be granted by superusers to others usingGRANT.

F.28.1. Functions#

pg_get_logical_snapshot_meta(filename text) returns record#

Gets logical snapshot metadata about a snapshot file that is located in the server'spg_logical/snapshots directory. Thefilename argument represents the snapshot file name. For example:

postgres=# SELECT * FROM pg_ls_logicalsnapdir();-[ RECORD 1 ]+-----------------------name         | 0-40796E18.snapsize         | 152modification | 2024-08-14 16:36:32+00postgres=# SELECT * FROM pg_get_logical_snapshot_meta('0-40796E18.snap');-[ RECORD 1 ]--------magic    | 1369563137checksum | 1028045905version  | 6postgres=# SELECT ss.name, meta.* FROM pg_ls_logicalsnapdir() AS ss,pg_get_logical_snapshot_meta(ss.name) AS meta;-[ RECORD 1 ]-------------name     | 0-40796E18.snapmagic    | 1369563137checksum | 1028045905version  | 6

Iffilename does not match a snapshot file, the function raises an error.

pg_get_logical_snapshot_info(filename text) returns record#

Gets logical snapshot information about a snapshot file that is located in the server'spg_logical/snapshots directory. Thefilename argument represents the snapshot file name. For example:

postgres=# SELECT * FROM pg_ls_logicalsnapdir();-[ RECORD 1 ]+-----------------------name         | 0-40796E18.snapsize         | 152modification | 2024-08-14 16:36:32+00postgres=# SELECT * FROM pg_get_logical_snapshot_info('0-40796E18.snap');-[ RECORD 1 ]------------+-----------state                    | consistentxmin                     | 751xmax                     | 751start_decoding_at        | 0/40796AF8two_phase_at             | 0/40796AF8initial_xmin_horizon     | 0building_full_snapshot   | fin_slot_creation         | flast_serialized_snapshot | 0/0next_phase_at            | 0committed_count          | 0committed_xip            |catchange_count          | 2catchange_xip            | {751,752}postgres=# SELECT ss.name, info.* FROM pg_ls_logicalsnapdir() AS ss,pg_get_logical_snapshot_info(ss.name) AS info;-[ RECORD 1 ]------------+----------------name                     | 0-40796E18.snapstate                    | consistentxmin                     | 751xmax                     | 751start_decoding_at        | 0/40796AF8two_phase_at             | 0/40796AF8initial_xmin_horizon     | 0building_full_snapshot   | fin_slot_creation         | flast_serialized_snapshot | 0/0next_phase_at            | 0committed_count          | 0committed_xip            |catchange_count          | 2catchange_xip            | {751,752}

Iffilename does not match a snapshot file, the function raises an error.

F.28.2. Author#

Bertrand Drouvot<bertranddrouvot.pg@gmail.com>


Prev Up Next
F.27. pg_freespacemap — examine the free space map Home F.29. pg_overexplain — allow EXPLAIN to dump even more details
epubpdf
Go to PostgreSQL 18
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp