mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Improve warning message in pg_signal_backend()
Previously, invoking pg_terminate_backend() or pg_cancel_backend() with the postmaster PID produced a "PID XXXX is not a PostgresSQL server process" warning, which does not make sense. Change to "backend process" to make the message more exact. Nathan Bossart, based on an idea from Bharath Rupireddy with input from Tom Lane and Euler Taveira Discussion: https://www.postgresql.org/message-id/flat/CALj2ACW7Rr-R7mBcBQiXWPp=JV5chajjTdudLiF5YcpW-BmHhg@mail.gmail.com
This commit is contained in:
parent
9cb5518b7f
commit
7fa945b857
@ -57,6 +57,10 @@ pg_signal_backend(int pid, int sig)
|
||||
* arbitrary process to prevent that. But since so far all the callers of
|
||||
* this mechanism involve some request for ending the process anyway, that
|
||||
* it might end on its own first is not a problem.
|
||||
*
|
||||
* Note that proc will also be NULL if the pid refers to an auxiliary
|
||||
* process or the postmaster (neither of which can be signaled via
|
||||
* pg_signal_backend()).
|
||||
*/
|
||||
if (proc == NULL)
|
||||
{
|
||||
@ -65,7 +69,8 @@ pg_signal_backend(int pid, int sig)
|
||||
* if one backend terminated on its own during the run.
|
||||
*/
|
||||
ereport(WARNING,
|
||||
(errmsg("PID %d is not a PostgreSQL server process", pid)));
|
||||
(errmsg("PID %d is not a PostgreSQL backend process", pid)));
|
||||
|
||||
return SIGNAL_BACKEND_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user