rename pg_log_standby_snapshot - Mailing list pgsql-hackers

From Sami Imseih
Subject rename pg_log_standby_snapshot
Date
Msg-id CAA5RZ0tfHbmfGi8uB7HFk+PBwNjQo=G_qf1jN=h248h++-HtTA@mail.gmail.com
Whole thread Raw
Responses Re: rename pg_log_standby_snapshot
List 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."


[1]
https://www.postgresql.org/message-id/flat/0e0e7ca08dff077a625c27a5e0c2ef0a%40oss.nttdata.com#6539312988e4695d2d416688a3ab34fa

--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Adding support for SSLKEYLOGFILE in the frontend
Next
From: Alexander Korotkov
Date:
Subject: Re: Removing unneeded self joins