1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Show more detail in heapam rmgr descriptions.

Add helper functions that output arrays in a standard format, and use
the functions inside heapdesc routines.  This allows tools like
pg_walinspect to show a detailed description of the page offset number
arrays for records like PRUNE and VACUUM (unless there was an FPI).

Also document the conventions that desc routines should follow.  Only
the heapdesc routines follow the conventions for now, so they're just
guidelines for the time being.

Based on a suggestion from Andres Freund.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-By: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/flat/20230109215842.fktuhesvayno6o4g%40awork3.anarazel.de
This commit is contained in:
Peter Geoghegan
2023-04-07 16:08:52 -07:00
parent 76c111a7f1
commit 7d8219a444
7 changed files with 247 additions and 40 deletions

View File

@ -71,19 +71,19 @@
after the <replaceable>in_lsn</replaceable> argument. For
example:
<screen>
postgres=# SELECT * FROM pg_get_wal_record_info('0/1E826E98');
-[ RECORD 1 ]----+----------------------------------------------------
start_lsn | 0/1E826F20
end_lsn | 0/1E826F60
prev_lsn | 0/1E826C80
postgres=# SELECT * FROM pg_get_wal_record_info('0/E84F5E8');
-[ RECORD 1 ]----+--------------------------------------------------
start_lsn | 0/E84F5E8
end_lsn | 0/E84F620
prev_lsn | 0/E84F5A8
xid | 0
resource_manager | Heap2
record_type | PRUNE
record_length | 58
main_data_length | 8
record_type | VACUUM
record_length | 50
main_data_length | 2
fpi_length | 0
description | snapshotConflictHorizon 33748 nredirected 0 ndead 2
block_ref | blkref #0: rel 1663/5/60221 fork main blk 2
description | nunused: 1, unused: [ 22 ]
block_ref | blkref #0: rel 1663/16389/20884 fork main blk 126
</screen>
</para>
<para>
@ -144,7 +144,7 @@ block_ref |
references. Returns one row per block reference per WAL record.
For example:
<screen>
postgres=# SELECT * FROM pg_get_wal_block_info('0/10E9D80', '0/10E9DC0') LIMIT 1;
postgres=# SELECT * FROM pg_get_wal_block_info('0/10E9D80', '0/10E9DC0');
-[ RECORD 1 ]-----+-----------------------------------
start_lsn | 0/10E9D80
end_lsn | 0/10E9DC0