Re: Should we improve "PID XXXX is not a PostgreSQL server process" warning for pg_terminate_backend(<<postmaster_pid>>)?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Euler Taveira <euler@eulerto.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2021-11-17T19:37:36Z
Lists: pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> On Wed, Nov 17, 2021 at 03:59:59PM -0300, Euler Taveira wrote:
>> I took a look at this patch. I have a few comments.
>> 
>> + ereport(WARNING,
>> + (errmsg("signalling postmaster with PID %d is not allowed", pid)));
>> 
>> I would say "signal postmaster PID 1234 is not allowed". It is not an
>> in-progress action.

> It's correct to say "signalling ... is not allowed", which means the same as
> "it is not allowed to signal ...".

Yeah, the grammar is fine as far as that goes.  What reads awkwardly to me
is inclusion of "with PID %d" in the middle of the sentence.  That seems
odd, not least because it leaves the impression that maybe it would've
been okay to signal some other postmaster with a different PID.

Frankly, I think the existing wording is fine and this patch adds
complication without making any useful improvement.  We could maybe change
"is not a PostgresSQL server process" to "is not a PostgresSQL backend
process", but I wouldn't go further than that.

			regards, tom lane



Commits

  1. Improve warning message in pg_signal_backend()