Re: Standardize LSN-based filename

From: Japin Li <japinli(at)hotmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Standardize LSN-based filename
Date: 2025-08-20 01:37:30
Message-ID: ME0P300MB0445CECF8FA6354454152D53B633A@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 20, 2025 at 12:37:27AM +0900, Fujii Masao wrote:
> On Wed, Aug 13, 2025 at 9:56 AM Japin Li <japinli(at)hotmail(dot)com> wrote:
> >
> > In commit 2633dae2e, I standardized the LSN formatting for log messages using
> > zero-padding. However, I mistakenly changed the snapshot file name[1].
> >
> > I'd like to standardize the LSN-based filename. What's your feedback on this?
>
> Thanks for starting a new thread on this topic!
>
> I understand it's worth standardizing LSN formatting in log messages
> so users can read them consistently across tools and easily compare
> values. On the other hand, is there a strong reason to also standardize
> file names with zero-padding? Is it just for consistency, or is it to make
> file names more sortable?
>

Yeah. It's for both consistency and for proper file sorting.

Zero-padding ensures that when a file system or tool sorts the snapshot files
alphabetically, the order is also chronological. For example, without
zero-padding, 2-1.snap would come before 10-1.snap, which is incorrect. With
zero-padding, the files would sort as 00000002-00000001.snap and
00000010-00000001.snap, which is the correct order.

--
Best regards,
Japin Li
ChengDu WenWu Information Technology Co., LTD.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-08-20 01:42:26 Don't treat virtual generated columns as missing statistics in vacuumdb --missing-stats-only
Previous Message Chao Li 2025-08-20 01:32:53 Re: Raw parse tree is not dumped to log