]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make invalid primary_slot_name follow standard GUC error reporting.
authorFujii Masao <fujii@postgresql.org>
Wed, 22 Oct 2025 11:13:15 +0000 (20:13 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 22 Oct 2025 11:13:15 +0000 (20:13 +0900)
commitcaf529aba22d5c9950239f56b6f3a2c3d1c09a6b
treebccd7ad3486ee9ed64949443774c6a40e3baf51a
parent59b215f7217f010c945f8371ab905739ebce114d
Make invalid primary_slot_name follow standard GUC error reporting.

Previously, if primary_slot_name was set to an invalid slot name and
the configuration file was reloaded, both the postmaster and all other
backend processes reported a WARNING. With many processes running,
this could produce a flood of duplicate messages. The problem was that
the GUC check hook for primary_slot_name reported errors at WARNING
level via ereport().

This commit changes the check hook to use GUC_check_errdetail() and
GUC_check_errhint() for error reporting. As with other GUC parameters,
this causes non-postmaster processes to log the message at DEBUG3,
so by default, only the postmaster's message appears in the log file.

Backpatch to all supported versions.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Chao Li <lic@highgo.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Discussion: https://postgr.es/m/CAHGQGwFud-cvthCTfusBfKHBS6Jj6kdAPTdLWKvP2qjUX6L_wA@mail.gmail.com
Backpatch-through: 13
src/backend/replication/slot.c
src/backend/utils/misc/guc.c
src/include/replication/slot.h