Re: rename pg_log_standby_snapshot

From: Andres Freund <andres(at)anarazel(dot)de>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rename pg_log_standby_snapshot
Date: 2025-04-06 02:32:40
Message-ID: k3lob3be46rpjcyrqzbigrzhud3ghga5slv4jnajro77ofzkzh@4acqogszkplh
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-04-04 11:55:41 -0500, Sami Imseih wrote:
> > > > 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)
>
> But unlike pg_log_backend_memory_contexts, the primary purpose
> of this function is not to write at the LOG message level.
>
> > - that name also makes sense from an API point of view as it calls "LogStandbySnapshot"
>
> I don't really see the correlation between the user facing pg_log_
> prefix and the Log prefixed
> functions that write to wal.
>
> But this goes back to the main point of should pg_log_ be specific to
> functions that
> write to the server logs only. I am making the argument that we
> should. We have a precedent
> with pg_stat_ being the prefix for any function related to the cumulative stats.
>
> I think it keeps things nicely organized and just overall good code
> hygiene, but also not sure
> how we can even enforce such naming conventions.

I think this would all be a nice argument to have when introducing a new
function. But I don't think it's a wart sufficiently big to justify breaking
compatibility.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2025-04-06 04:02:38 Re: Removing unneeded self joins
Previous Message Andres Freund 2025-04-06 02:30:54 Re: A modest proposal: make parser/rewriter/planner inputs read-only