pgsql: Rework design of functions in pg_walinspect

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Rework design of functions in pg_walinspect
Date: 2023-03-14 11:14:44
Message-ID: E1pc2c8-003UXc-Cm@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c1b6628075a30b4eed6eb5835c2d2734254fa86

Modified Files
--------------
contrib/pg_walinspect/expected/oldextversions.out | 46 ++++-
contrib/pg_walinspect/expected/pg_walinspect.out | 42 ++---
contrib/pg_walinspect/pg_walinspect--1.0--1.1.sql | 4 +
contrib/pg_walinspect/pg_walinspect.c | 215 +++++++++-------------
contrib/pg_walinspect/sql/oldextversions.sql | 19 ++
contrib/pg_walinspect/sql/pg_walinspect.sql | 6 +-
doc/src/sgml/pgwalinspect.sgml | 59 ++----
7 files changed, 184 insertions(+), 207 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-03-14 13:43:48 pgsql: doc: spell out full productname
Previous Message Christoph Berg 2023-03-14 10:34:08 Re: lz4 --rm on Ubuntu 18.04 (Add LZ4 compression to pg_dump)