Add pg_dissect_walfile_name()
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +33 −0 |
| src/backend/access/transam/xlogfuncs.c | modified | +53 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +7 −0 |
| src/test/regress/expected/misc_functions.out | modified | +23 −0 |
| src/test/regress/sql/misc_functions.sql | modified | +8 −0 |
Documentation touched
Discussion
- Add LSN along with offset to error messages reported for WAL file read/write/validate header failures 42 messages · 2022-09-19 → 2022-12-23