Re: Add pg_walinspect function with block info columns - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Add pg_walinspect function with block info columns
Date
Msg-id CALj2ACVWXOQK2HScKj+mFkxHbFaui3tH95cmZ3+hX=insNwKPg@mail.gmail.com
Whole thread Raw
In response to Re: Add pg_walinspect function with block info columns  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Mon, Mar 27, 2023 at 9:11 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Sat, 25 Mar 2023 12:12:50 +0900, Michael Paquier <michael@paquier.xyz> wrote in
> > On Thu, Mar 23, 2023 at 10:54:40PM +0530, Bharath Rupireddy wrote:
> >         OUT reltablespace oid,
> >         OUT reldatabase oid,
> >         OUT relfilenode oid,
> >         OUT relblocknumber int8,
> > +       OUT blockid int2,
> > +    OUT start_lsn pg_lsn,
> > +    OUT end_lsn pg_lsn,
> > +    OUT prev_lsn pg_lsn,
> >
> > I'd still put the LSN data before the three OIDs for consistency with
> > the structures, though my opinion does not seem to count much..
>
> I agree with Michael on this point. Also, although it may not be
> significant for SQL, the rows are output in lsn order from the
> function.

Done that way.

On Sat, Mar 25, 2023 at 8:42 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Thu, Mar 23, 2023 at 10:54:40PM +0530, Bharath Rupireddy wrote:
> > Please see the attached v4 patch set addressing all the review comments.
>
> -   desc = GetRmgr(XLogRecGetRmid(record));
> -   id = desc.rm_identify(XLogRecGetInfo(record));
> -
> -   if (id == NULL)
> -       id = psprintf("UNKNOWN (%x)", XLogRecGetInfo(record) & ~XLR_INFO_MASK);
> -
> -   initStringInfo(&rec_desc);
> -   desc.rm_desc(&rec_desc, record);
> -
> -   /* Block references. */
> -   initStringInfo(&rec_blk_ref);
> -   XLogRecGetBlockRefInfo(record, false, true, &rec_blk_ref, &fpi_len);
> -
> -   main_data_len = XLogRecGetDataLen(record);
>
> I don't see any need to move this block of code?  This leads to
> unnecessary diffs, potentially making backpatch a bit harder.  Either
> way is not a big deal, still..  Except for this bit, 0001 looks fine
> by me.

It's a cosmetic change - I wanted to keep the calculation of column
values closer to where they're assigned to Datum values. I agree to
not cause too much diff and removed them.

Please see the attached v5 patch set.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Support logical replication of DDLs
Next
From: Michael Paquier
Date:
Subject: Re: Add pg_walinspect function with block info columns