Rework design of functions in pg_walinspect
authorMichael Paquier <michael@paquier.xyz>
Tue, 14 Mar 2023 11:13:02 +0000 (20:13 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 14 Mar 2023 11:13:02 +0000 (20:13 +0900)
commit5c1b6628075a30b4eed6eb5835c2d2734254fa86
tree8b26a37ff2042a54fc2fdb84c33f4bb275360bf9
parentd5d574146d71c362852748c82ba8b9c873f5bf24
Rework design of functions in pg_walinspect

This commit reworks a bit the set-returning functions of pg_walinspect,
making them more flexible regarding their end LSN:
- pg_get_wal_records_info()
- pg_get_wal_stats()
- pg_get_wal_block_info()

The end LSNs given to these functions is now handled so as a value
higher than the current LSN of the cluster (insert LSN for a primary, or
replay LSN for a standby) does not raise an error, giving more
flexibility to monitoring queries.  Instead, the functions return
results up to the current LSN, as found at the beginning of each
function call.

As an effect of that, pg_get_wal_records_info_till_end_of_wal() and
pg_get_wal_stats_till_end_of_wal() are now removed from 1.1, as the
existing, equivalent functions are able to offer the same
possibilities.

Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACU0_q-o4DSweyaW9NO1KBx-QkN6G_OzYQvpjf3CZVASkg@mail.gmail.com
contrib/pg_walinspect/expected/oldextversions.out
contrib/pg_walinspect/expected/pg_walinspect.out
contrib/pg_walinspect/pg_walinspect--1.0--1.1.sql
contrib/pg_walinspect/pg_walinspect.c
contrib/pg_walinspect/sql/oldextversions.sql
contrib/pg_walinspect/sql/pg_walinspect.sql
doc/src/sgml/pgwalinspect.sgml