Re: Inconsistent LSN format in pg_waldump output

Поиск
Список
Период
Сортировка
Искать

Re: Inconsistent LSN format in pg_waldump output

От:
Masahiko Sawada <sawada.mshk@gmail.com>
Дата:
On Fri, Jul 4, 2025 at 8:01 PM Álvaro Herrera  wrote:
>
> On 2025-Jul-04, Japin Li wrote:
>
> > I've opted to directly use %X/%08X for LSN formatting in this patch, with an
> > accompanying comment near LSN_FORMAT_ARGS.
>
> Thank you!  I support this approach and intend to work on getting this
> patch committed soon after some more review, unless there are further
> objections.

+1. I think we need to update LSN values in the documentation too.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com


Re: Inconsistent LSN format in pg_waldump output

От:
Álvaro Herrera <alvherre@kurilemu.de>
Дата:
On 2025-Jul-05, Masahiko Sawada wrote:

> On Fri, Jul 4, 2025 at 8:01 PM Álvaro Herrera  wrote:
> >
> > On 2025-Jul-04, Japin Li wrote:
> >
> > > I've opted to directly use %X/%08X for LSN formatting in this patch, with an
> > > accompanying comment near LSN_FORMAT_ARGS.
> >
> > Thank you!  I support this approach and intend to work on getting this
> > patch committed soon after some more review, unless there are further
> > objections.
> 
> +1. I think we need to update LSN values in the documentation too.

You're right, we had a few of those.  I grepped for them and adjusted
what I found.  I could have missed some, because there's a bunch of
other values that also look like slash-separated hexadecimal numbers.
The only case where I did something other than adding a leading zero was
the example output for gist_page_opaque_info() because I wasn't sure
that the 'nsn' column was also going to be printed as an LSN :-) so I
just ran the example query using one index from the regression database.

And pushed.  Thanks!

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"No tengo por qué estar de acuerdo con lo que pienso"
                             (Carlos Caszeli)


Re: Inconsistent LSN format in pg_waldump output

От:
Japin Li <japinli@hotmail.com>
Дата:
On Mon, 07 Jul 2025 at 14:18, Álvaro Herrera  wrote:
> On 2025-Jul-05, Masahiko Sawada wrote:
>
>> On Fri, Jul 4, 2025 at 8:01 PM Álvaro Herrera  wrote:
>> >
>> > On 2025-Jul-04, Japin Li wrote:
>> >
>> > > I've opted to directly use %X/%08X for LSN formatting in this patch, with an
>> > > accompanying comment near LSN_FORMAT_ARGS.
>> >
>> > Thank you!  I support this approach and intend to work on getting this
>> > patch committed soon after some more review, unless there are further
>> > objections.
>> 
>> +1. I think we need to update LSN values in the documentation too.
>
> You're right, we had a few of those.  I grepped for them and adjusted
> what I found.  I could have missed some, because there's a bunch of
> other values that also look like slash-separated hexadecimal numbers.
> The only case where I did something other than adding a leading zero was
> the example output for gist_page_opaque_info() because I wasn't sure
> that the 'nsn' column was also going to be printed as an LSN :-) so I
> just ran the example query using one index from the regression database.
>
> And pushed.  Thanks!

Thank you for pushing this patch.  I noticed some other areas in the
documentation that could also use an update.

diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 49a7c180a80..0994e089311 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -5121,7 +5121,7 @@ WHERE ...
     +(pg_lsn,numeric) and
     -(pg_lsn,numeric) operators, respectively. Note that
     the calculated LSN should be in the range of pg_lsn type,
-    i.e., between 0/0 and
+    i.e., between 0/00000000 and
     FFFFFFFF/FFFFFFFF.
    
   
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 810b2b50f0d..c28aa71f570 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -28521,7 +28521,7 @@ acl      | {postgres=arwdDxtm/postgres,foo=r/postgres}
         Returns information about the progress of the WAL summarizer. If the
         WAL summarizer has never run since the instance was started, then
         summarized_tli and summarized_lsn
-        will be 0 and 0/0 respectively;
+        will be 0 and 0/00000000 respectively;
         otherwise, they will be the TLI and ending LSN of the last WAL summary
         file written to disk. If the WAL summarizer is currently running,
         pending_lsn will be the ending LSN of the last

I suggest we avoid changing the border style here.

+    lsn     │    nsn     │ rightlink │ flags
+────────────┼────────────┼───────────┼────────
+ 0/0B5FE088 │ 0/00000000 │         1 │ {leaf}

-- 
Regards,
Japin Li


Re: Inconsistent LSN format in pg_waldump output

От:
Álvaro Herrera <alvherre@kurilemu.de>
Дата:
On 2025-Jul-07, Japin Li wrote:

> Thank you for pushing this patch.  I noticed some other areas in the
> documentation that could also use an update.

Thanks!  Pushed these fixes.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
Syntax error: function hell() needs an argument.
Please choose what hell you want to involve.


Re: Inconsistent LSN format in pg_waldump output

От:
Álvaro Herrera <alvherre@kurilemu.de>
Дата:
Вложения:
I found an old patch in my local worktree closely related to this work;
here we take the additional step of changing the pattern used for .snap
file names in logical decoding to use %X/%08X as the other patterns we
changed for this.  This changes both the sscanf() part of it as well as
sprinft().

Any objections against this?

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
FAQ