/
Ao
/
MaxReport
Обзор
Документация
Войти
/
Ao
/
MaxReport
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
pgsql/doc/src/sgml/html/pglogicalinspect.html
100 строк
8 KB
AoAnima
first_commit
13 июл 2026, 17:47
13 июл 2026, 17:47
f1a670a
Код
Авторство
О чём код?
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.28. pg_logicalinspect — logical decoding components inspection</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="pgfreespacemap.html" title="F.27. pg_freespacemap — examine the free space map" /><link rel="next" href="pgoverexplain.html" title="F.29. pg_overexplain — allow EXPLAIN to dump even more details" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.28. pg_logicalinspect — logical decoding components inspection</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgfreespacemap.html" title="F.27. pg_freespacemap — examine the free space map">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules and Extensions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="pgoverexplain.html" title="F.29. pg_overexplain — allow EXPLAIN to dump even more details">Next</a></td></tr></table><hr /></div><div class="sect1" id="PGLOGICALINSPECT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.28. pg_logicalinspect — logical decoding components inspection <a href="#PGLOGICALINSPECT" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="pglogicalinspect.html#PGLOGICALINSPECT-FUNCS">F.28.1. Functions</a></span></dt><dt><span class="sect2"><a href="pglogicalinspect.html#PGLOGICALINSPECT-AUTHOR">F.28.2. Author</a></span></dt></dl></div><a id="id-1.11.7.38.2" class="indexterm"></a><p> The <code class="filename">pg_logicalinspect</code> 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 running <span class="productname">PostgreSQL</span> database cluster, which is useful for debugging or educational purposes. </p><p> By default, use of these functions is restricted to superusers and members of the <code class="literal">pg_read_server_files</code> role. Access may be granted by superusers to others using <code class="command">GRANT</code>. </p><div class="sect2" id="PGLOGICALINSPECT-FUNCS"><div class="titlepage"><div><div><h3 class="title">F.28.1. Functions <a href="#PGLOGICALINSPECT-FUNCS" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="PGLOGICALINSPECT-FUNCS-PG-GET-LOGICAL-SNAPSHOT-META"><span class="term"> <code class="function">pg_get_logical_snapshot_meta(filename text) returns record</code> </span> <a href="#PGLOGICALINSPECT-FUNCS-PG-GET-LOGICAL-SNAPSHOT-META" class="id_link">#</a></dt><dd><p> Gets logical snapshot metadata about a snapshot file that is located in the server's <code class="filename">pg_logical/snapshots</code> directory. The <em class="replaceable"><code>filename</code></em> argument represents the snapshot file name. For example: </p><pre class="screen"> postgres=# SELECT * FROM pg_ls_logicalsnapdir(); -[ RECORD 1 ]+----------------------- name | 0-40796E18.snap size | 152 modification | 2024-08-14 16:36:32+00 postgres=# SELECT * FROM pg_get_logical_snapshot_meta('0-40796E18.snap'); -[ RECORD 1 ]-------- magic | 1369563137 checksum | 1028045905 version | 6 postgres=# SELECT ss.name, meta.* FROM pg_ls_logicalsnapdir() AS ss, pg_get_logical_snapshot_meta(ss.name) AS meta; -[ RECORD 1 ]------------- name | 0-40796E18.snap magic | 1369563137 checksum | 1028045905 version | 6 </pre><p> </p><p> If <em class="replaceable"><code>filename</code></em> does not match a snapshot file, the function raises an error. </p></dd><dt id="PGLOGICALINSPECT-FUNCS-PG-GET-LOGICAL-SNAPSHOT-INFO"><span class="term"> <code class="function">pg_get_logical_snapshot_info(filename text) returns record</code> </span> <a href="#PGLOGICALINSPECT-FUNCS-PG-GET-LOGICAL-SNAPSHOT-INFO" class="id_link">#</a></dt><dd><p> Gets logical snapshot information about a snapshot file that is located in the server's <code class="filename">pg_logical/snapshots</code> directory. The <em class="replaceable"><code>filename</code></em> argument represents the snapshot file name. For example: </p><pre class="screen"> postgres=# SELECT * FROM pg_ls_logicalsnapdir(); -[ RECORD 1 ]+----------------------- name | 0-40796E18.snap size | 152 modification | 2024-08-14 16:36:32+00 postgres=# SELECT * FROM pg_get_logical_snapshot_info('0-40796E18.snap'); -[ RECORD 1 ]------------+----------- state | consistent xmin | 751 xmax | 751 start_decoding_at | 0/40796AF8 two_phase_at | 0/40796AF8 initial_xmin_horizon | 0 building_full_snapshot | f in_slot_creation | f last_serialized_snapshot | 0/0 next_phase_at | 0 committed_count | 0 committed_xip | catchange_count | 2 catchange_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.snap state | consistent xmin | 751 xmax | 751 start_decoding_at | 0/40796AF8 two_phase_at | 0/40796AF8 initial_xmin_horizon | 0 building_full_snapshot | f in_slot_creation | f last_serialized_snapshot | 0/0 next_phase_at | 0 committed_count | 0 committed_xip | catchange_count | 2 catchange_xip | {751,752} </pre><p> </p><p> If <em class="replaceable"><code>filename</code></em> does not match a snapshot file, the function raises an error. </p></dd></dl></div></div><div class="sect2" id="PGLOGICALINSPECT-AUTHOR"><div class="titlepage"><div><div><h3 class="title">F.28.2. Author <a href="#PGLOGICALINSPECT-AUTHOR" class="id_link">#</a></h3></div></div></div><p> Bertrand Drouvot <code class="email"><<a class="email" href="mailto:bertranddrouvot.pg@gmail.com">bertranddrouvot.pg@gmail.com</a>></code> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgfreespacemap.html" title="F.27. pg_freespacemap — examine the free space map">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pgoverexplain.html" title="F.29. pg_overexplain — allow EXPLAIN to dump even more details">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.27. pg_freespacemap — examine the free space map </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.29. pg_overexplain — allow EXPLAIN to dump even more details</td></tr></table></div></body></html>