pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add pg_dissect_walfile_name()
Date: Tue, 20 Dec 2022 04:38:27 +0000
Message-ID: <E1p7UOY-004V9k-7J@gemulon.postgresql.org> (raw)

Add pg_dissect_walfile_name()

This function takes in input a WAL segment name and returns a tuple made
of the segment sequence number (dependent on the WAL segment size of the
cluster) and its timeline, as of a thin SQL wrapper around the existing
XLogFromFileName().

This function has multiple usages, like being able to compile a LSN from
a file name and an offset, or finding the timeline of a segment without
having to do to some maths based on the first eight characters of the
segment.

Bump catalog version.

Author: Bharath Rupireddy
Reviewed-by: Nathan Bossart, Kyotaro Horiguchi, Maxim Orlov, Michael
Paquier
Discussion: https://postgr.es/m/CALj2ACWV=FCddsxcGbVOA=cvPyMr75YCFbSQT6g4KDj=gcJK4g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cca186348929cd75f23ef1b25922386bf38cf99c

Modified Files
--------------
doc/src/sgml/func.sgml                       | 33 +++++++++++++++++
src/backend/access/transam/xlogfuncs.c       | 53 ++++++++++++++++++++++++++++
src/include/catalog/catversion.h             |  2 +-
src/include/catalog/pg_proc.dat              |  7 ++++
src/test/regress/expected/misc_functions.out | 23 ++++++++++++
src/test/regress/sql/misc_functions.sql      |  8 +++++
6 files changed, 125 insertions(+), 1 deletion(-)



Message-ID: <E1p7UOY-004V9k-7J@gemulon.postgresql.org>
Permalink:  ../E1p7UOY-004V9k-7J@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p7UOY-004V9k-7J@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Add pg_dissect_walfile_name()
  In-Reply-To: <E1p7UOY-004V9k-7J@gemulon.postgresql.org>
  References: <E1p7UOY-004V9k-7J@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox