]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add errdetail() with PID and UID about source of termination signal.
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 6 Apr 2026 16:39:14 +0000 (12:39 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 7 Apr 2026 14:22:33 +0000 (10:22 -0400)
commit55890a919454a2165031a04b175ca92e3ed70e69
tree656d44350614351b840cf379a424ff22e0047188
parentc10edb102ada607eb054bc9e23690109d86849ef
Add errdetail() with PID and UID about source of termination signal.

When a backend is terminated via pg_terminate_backend() or an external
SIGTERM, the error message now includes the sender's PID and UID as
errdetail, making it easier to identify the source of unexpected
terminations in multi-user environments.

On platforms that support SA_SIGINFO (Linux, FreeBSD, and most modern
Unix systems), the signal handler captures si_pid and si_uid from the
siginfo_t structure.  On platforms without SA_SIGINFO, the detail is
simply omitted.

Author: Jakub Wartak <jakub.wartak@enterprisedb.com>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Reviewed-by: Chao Li <1356863904@qq.com>
Discussion: https://postgr.es/m/CAKZiRmyrOWovZSdixpLd3PGMQXuQL_zw2Ght5XhHCkQ1uDsxjw@mail.gmail.com
configure
configure.ac
meson.build
src/backend/replication/syncrep.c
src/backend/tcop/postgres.c
src/backend/utils/init/globals.c
src/bin/psql/t/001_basic.pl
src/include/miscadmin.h
src/include/pg_config.h.in
src/port/pqsignal.c