Re: rename pg_log_standby_snapshot

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rename pg_log_standby_snapshot
Date: 2025-04-04 10:40:19
Message-ID: CAA4eK1+oER4TTraQegN02GD905jmpQgg7q_D9ZmVw4Hoq0Gb2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 3, 2025 at 9:30 PM Sami Imseih <samimseih(at)gmail(dot)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, but your question has
merit and deserves some bike-shedding because the user can get
confused with the term *_log_* in the function name that intends to
write a WAL record for standby_snapshot.

> If so, should we rename
> pg_log_standby_snapshot to something else, such as
> pg_standby_snapshot_xip_to_wal?
>

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.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-04-04 10:45:23 Re: Improve error reporting for few options in pg_createsubscriber
Previous Message Antonin Houska 2025-04-04 10:28:36 Re: why there is not VACUUM FULL CONCURRENTLY?