Re: Inconsistent LSN format in pg_waldump output

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Inconsistent LSN format in pg_waldump output
Date: 2025-07-02 18:57:45
Message-ID: 202507021857.dujtjvaunzv3@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Jul-03, Masahiko Sawada wrote:

> On Wed, Jul 2, 2025 at 10:56 PM Japin Li <japinli(at)hotmail(dot)com> wrote:

> Interesting. While this is a better format, could it break
> compatibility with existing tools that for example compares LSN
> strings?

I think a tool would have to be severely miswritten in order to become
broken from this change. Our own code to scan LSNs is to use
scanf('%X/%X') which should work just fine with and without the leading
zeroes. I honestly don't see anybody coding this in any different way
that could not cope with the leading zeroes :-)

> > > Agreed. I believe %X/%08X is better.
> >
> > Patch to standardize LSN formatting with zero-padding.
>
> Thank you for updating the patch. I think this patch doesn't need to
> update .po files as we do that at once when doing the translation
> update.

Agreed. In fact these updates are probably harmful (they certainly
bloat the patch quite a bit). These files come from a different
repository, which you're welcome to provide a patch for, after the code
change lands in Postgres.
https://git.postgresql.org/cgit/pgtranslation/messages.git/

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Porque Kim no hacía nada, pero, eso sí,
con extraordinario éxito" ("Kim", Kipling)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-07-02 19:11:15 Re: add function for creating/attaching hash table in DSM registry
Previous Message Giacchino, Luca 2025-07-02 18:26:56 RE: Proposal for optimizations with simd enabled sort