Re: Add contrib/pg_logicalsnapinspect

Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-08-27T19:55:35Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix indentation issue

  2. pg_logicalinspect: Stabilize isolation tests.

  3. Add contrib/pg_logicalinspect.

  4. Move SnapBuild and SnapBuildOnDisk structs to snapshot_internal.h.

Hi,

On Mon, Aug 26, 2024 at 07:05:27PM +0530, Amit Kapila wrote:
> On Thu, Aug 22, 2024 at 5:56 PM Bertrand Drouvot
> <bertranddrouvot.pg@gmail.com> wrote:
> >
> > Please find attached a patch to $SUBJECT.
> >
> > This module provides SQL functions to inspect the contents of serialized logical
> > snapshots of a running database cluster, which I think could be useful for
> > debugging or educational purposes.
> >
> 
> +1. I see it could be a good debugging aid.

Thanks for the feedback!

> >
> > 2. The SnapBuildOnDisk and SnapBuild structs are now exposed to public. Means
> > we should now pay much more attention when changing their contents but I think
> > it's worth it.
> >
> 
> Is it possible to avoid exposing these structures? Can we expose some
> function from snapbuild.c that provides the required information?

Yeah, that's an option if we don't want to expose those structs to public.

I think we could 1/ create a function that would return a formed HeapTuple, or
2/ we could create multiple functions (about 15) that would return the values
we are interested in.

I think 2/ is fine as it would give more flexiblity (no need to retrieve a whole
tuple if one is interested to only one value).

What do you think? Did you have something else in mind?

Regards,

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