On Tue, Nov 4, 2025 at 8:58 AM Tom Lane <[email protected]> wrote:
>
> I wrote:
> > Andrei Klychkov <[email protected]> writes:
> >> 2. It doesn't look to me that v5 solves the original issue of a user
> >> running ALTER SYSTEM SET <setting like shared_preload_libraries> = ''; ,
> >> then restarting the server and not getting it back online.
>
> > [ shrug... ] It's not supposed to "solve" that. That command is
> > erroneous, and if you didn't test the setting before restarting the
> > server, you shouldn't be too surprised if restart fails.
>
> If you are feeling excited about that specific case, I think the
> correct solution would be to install a GUC check_hook for
> shared_preload_libraries (and probably its siblings too). It couldn't
> go so far as to actually dlopen() the list items, but it could check
> that each one resolves as an accessible file.
Independently of the file-check question, should we consider enforcing
that any GUC_LIST_QUOTE parameters without an explicit check_hook must
at least pass the SplitGUCList() parser?
Fujii-san pointed out in [1] that my output_plugin_libraries addition
doesn't have a check_hook, so a superuser can accidentally put bad
list syntax into postgresql.conf and then fail later rather than at
startup. I wouldn't want to backport stricter behavior for the old
GUCs, but I do want to fix that for the new one. And for PG20 onwards
that seems like a QoL improvement for all of them.
Thanks,
--Jacob
P.S. This overlaps a bit with f3eb76b399, because the comments added
there make it seem like we can't get into this situation, but we can:
=# CREATE FUNCTION add(integer, integer)
RETURNS integer AS 'select $1 + $2;'
LANGUAGE SQL;
CREATE FUNCTION
=# show session_preload_libraries;
session_preload_libraries
---------------------------
test_decoding,
(1 row)
=# ALTER FUNCTION add (integer, integer)
SET session_preload_libraries FROM CURRENT;
ALTER FUNCTION
=# select pg_get_functiondef('add'::regproc);
ERROR: invalid list syntax in proconfig item
[1]
https://postgr.es/m/CAHGQGwG81iHN46mY_19Bne5RuKfAjH4dOnQ7-8i%3D7KYJk_0rAg%40mail.gmail.com