From: | Sami Imseih <samimseih(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | rename pg_log_standby_snapshot |
Date: | 2025-04-03 16:00:28 |
Message-ID: | CAA5RZ0tfHbmfGi8uB7HFk+PBwNjQo=G_qf1jN=h248h++-HtTA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
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? If so, should we rename
pg_log_standby_snapshot to something else, such as
pg_standby_snapshot_xip_to_wal?
This name is long, but it is still shorter than other system function
names and clearly describes
what the function does.
Additionally, this name is similar to pg_snapshot_xip, which returns
in-progress transactions.
Also, pg_snapshot_ is a good prefix for future functions that operate
on standbys only.
Another minor thing: the documentation for pg_log_standby_snapshot
function currently says,
"Take a snapshot of running transactions and write it to WAL."
However, we commonly refer to these transactions as "in-progress transactions."
So, maybe the documentation should say, "Take a snapshot of
in-progress transactions and write it to WAL."
--
Sami Imseih
Amazon Web Services (AWS)
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Korotkov | 2025-04-03 16:02:16 | Re: Removing unneeded self joins |
Previous Message | Daniel Gustafsson | 2025-04-03 15:51:11 | Re: Adding support for SSLKEYLOGFILE in the frontend |