Re: rename pg_log_standby_snapshot - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: rename pg_log_standby_snapshot
Date
Msg-id Z++7M2urBAnXuGbn@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: rename pg_log_standby_snapshot  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: rename pg_log_standby_snapshot
List pgsql-hackers
Hi,

On Fri, Apr 04, 2025 at 04:10:19PM +0530, Amit Kapila wrote:
> On Thu, Apr 3, 2025 at 9:30 PM Sami Imseih <samimseih@gmail.com> wrote:
> >
> > While looking at [1] which introduces a new function called pg_log_query_plan to
> > write an explain plan to the log file, I noticed that we currently
> > have overloaded
> > the meaning of the "pg_log_" prefix.
> >
> > Currently there is pg_log_backend_memory_contexts which logs memory
> > contexts to the log file, but there is also a pg_log_standby_snapshot  which
> > takes a snapshot of running transactions and writes them to wal, so it has
> > nothing to do with writing to the log file.
> >
> >                                       List of functions
> >    Schema   |              Name              | Result data type |
> > Argument data types | Type
> > ------------+--------------------------------+------------------+---------------------+------
> >  pg_catalog | pg_log_backend_memory_contexts | boolean          |
> > integer             | func
> >  pg_catalog | pg_log_standby_snapshot        | pg_lsn           |
> >                | func
> > (3 rows)
> >
> > Should the pg_log_ prefix strictly refer to functions that write to
> > logs?
> >
> 
> I don't know how strict we should be about this,

I don't know as well and specially given that:

- the snapshot is logged to the log file (if log level <= DEBUG2)
- the doc explains what the function does
- that name also makes sense from an API point of view as it calls "LogStandbySnapshot"

> The other option could be pg_create_standby_snapshot(), which would be
> similar to the existing function pg_create_restore_point(). I think we
> need to think about backward compatibility if we agree with moving in
> this direction.

+1

Regards,

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



pgsql-hackers by date:

Previous
From: Jakub Wartak
Date:
Subject: Re: Better HINT message for "unexpected data beyond EOF"
Next
From: Ashutosh Bapat
Date:
Subject: Re: Test to dump and restore objects left behind by regression