Invalid primary_slot_name triggers warnings in all processes on reload
Fujii Masao <masao.fujii@gmail.com>
From: Fujii Masao <masao.fujii@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-12T12:12:09Z
Lists: pgsql-hackers
Hi, While reviewing the patch at [1], I noticed that if primary_slot_name is set to an invalid slot name in postgresql.conf and the configuration file is reloaded, all running postgres processes emit the WARNING message as follows. Isn't this a bug? To fix this issue, GUC_check_errmsg() should be used instead of ereport() when an invalid slot name is found in the setting. Thoughts? ------------------------------------ $ initdb -D data $ pg_ctl -D data start $ psql <<EOF ALTER SYSTEM SET log_line_prefix TO '[%b] '; SELECT pg_reload_conf(); \! echo "primary_slot_name = 'invalid-'" >> data/postgresql.conf SELECT pg_reload_conf(); EOF [postmaster] WARNING: replication slot name "invalid-" contains invalid character [postmaster] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [postmaster] LOG: invalid value for parameter "primary_slot_name": "invalid-" [postmaster] LOG: configuration file "/System/Volumes/Data/dav/head-pgsql/data/postgresql.conf" contains errors; unaffected changes were applied [logical replication launcher] WARNING: replication slot name "invalid-" contains invalid character [logical replication launcher] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [checkpointer] WARNING: replication slot name "invalid-" contains invalid character [checkpointer] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [walwriter] WARNING: replication slot name "invalid-" contains invalid character [walwriter] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. hrk:head-pgsql postgres$ [background writer] WARNING: replication slot name "invalid-" contains invalid character [background writer] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [io worker] WARNING: replication slot name "invalid-" contains invalid character [io worker] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [io worker] WARNING: replication slot name "invalid-" contains invalid character [io worker] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [autovacuum launcher] WARNING: replication slot name "invalid-" contains invalid character [autovacuum launcher] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. [io worker] WARNING: replication slot name "invalid-" contains invalid character [io worker] HINT: Replication slot names may only contain lower case letters, numbers, and the underscore character. ------------------------------------ Regards, [1] http://postgr.es/m/CANhcyEUUWJ7XBycqFuqQg=eZ_==KT6S7E+rdMy-GE23oLa8tmQ@mail.gmail.com -- Fujii Masao
Commits
-
Make invalid primary_slot_name follow standard GUC error reporting.
- b00a16baeb2a 13.23 landed
- f106f53df6f5 14.20 landed
- caf529aba22d 15.15 landed
- 4fd916eab99c 16.11 landed
- 1db2870bb5ab 17.7 landed
- 6ff7ba9fe525 18.1 landed
- f33e60a53a9c 19 (unreleased) landed