Re: [Util] Warn and Remove Invalid GUCs

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, Shaik Mohammad Mujeeb <mujeeb(dot)sk(at)zohocorp(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, mujeebskdev <mujeeb(dot)sk(dot)dev(at)gmail(dot)com>
Subject: Re: [Util] Warn and Remove Invalid GUCs
Date: 2025-05-22 21:46:10
Message-ID: CAKFQuwaJbu8p6d1x-xXSMy5bfv1xL0B_U4mQdXQsfWDe9fS--w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 22, 2025 at 1:20 PM Greg Sabino Mullane <htamfids(at)gmail(dot)com>
wrote:

> On Thu, May 22, 2025 at 12:45 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> > "lpgsql.bogus = 1" .
>>
>> [ shrug... ] How do you know that's a bogus prefix? It could perfectly
>> well be a fully valid setting for an extension that
>> the installation doesn't choose to preload.
>>
>
> Well, we do have ways to view all *potential* extensions. I find myself
> more sympathetic to the OP than the others here, as I think it's a good
> idea to display a warning for a potentially misspelled GUC prefix (but do
> nothing else - certainly not remove it!). Will such a warning be seen?
> Perhaps not, but that's a risk any warning message has to face. And
> obviously there could be false positives if an extension decides to name
> their GUCs something other than pg_available_extensions()->name but
> hopefully that's a rare case (and shame on them if so.)
>

We don't have proper server variables for applications and non-extensions
to use in things like RLS so choosing a non-extension-registered prefix is
a perfectly valid thing to do. Maybe it would seldom be done in the config
file, and be nominally reserved for SET/set_config, but it is still valid.

IMO, an improvement in this area would revolve around not making people
type out setting names manually at all. If they don't type them they
cannot typo them. Again, this also only improves the config file setup,
but why not add pre-made configuration samples in a subdirectory that
people can either copy/paste individually; or setup a default include_dir
directive for contrib and people can place the "sample" files into the live
"contrib.d" directory making them no longer just samples but live
configuration that can then be edited without having to type names - just
remove comment symbols (maybe) and change values.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-05-22 21:53:06 Re: [Util] Warn and Remove Invalid GUCs
Previous Message Jeff Davis 2025-05-22 21:29:29 Re: Statistics Import and Export