Re: Emit a warning if the extension's GUC is set incorrectly

From: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: peter(dot)eisentraut(at)enterprisedb(dot)com, masao(dot)fujii(at)oss(dot)nttdata(dot)com, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, daniel(at)yesql(dot)se, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Emit a warning if the extension's GUC is set incorrectly
Date: 2021-12-22 07:50:34
Message-ID: f055f52eeedba4a4fc69a3e0dc5dc176@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-12-22 02:23, Tom Lane wrote:
> Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> writes:
>> At Mon, 20 Dec 2021 21:05:23 +0900, Shinya Kato
>> <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com> wrote in
>>> We should use EmitWarningsOnPlaceholders when we use
>>> DefineCustomXXXVariable.
>>> I don't think there is any room for debate.
>
>> Unfortunately, pltcl.c defines variables both in pltcl and pltclu but
>> the patch adds the warning only for pltclu.
>
> Right. The rest of 0001 looks fine, so pushed with that correction.
>
> I concur that 0002 is unacceptable. The result of it will be that
> a freshly-loaded extension will fail to hook into the system as it
> should, because it will fail to complete its initialization.
> That will cause user frustration and bug reports.
>
> (BTW, I wonder if EmitWarningsOnPlaceholders should be using LOG
> rather than WARNING when it's running in the postmaster. Use of
> WARNING is moderately likely to result in nothing getting printed
> at all.)
>
> 0003 looks to me like it was superseded by 75d22069e. I do not
> particularly like that patch though; it seems both inefficient
> and ill-designed. 0003 is adding a check in an equally bizarre
> place. Why isn't add_placeholder_variable the place to deal
> with this? Also, once we know that a prefix is reserved,
> why don't we throw an error not just a warning for attempts to
> set some unknown variable under that prefix? We don't allow
> you to set unknown non-prefixed variables.
>
> regards, tom lane

Thank you for pushing!
Thank you all for the reviews, I think I will take down 0002 and 0003.

--
Regards,

--
Shinya Kato
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-12-22 07:57:11 Re: Unifying VACUUM VERBOSE and log_autovacuum_min_duration output
Previous Message Michael Paquier 2021-12-22 07:47:12 Re: pg_upgrade should truncate/remove its logs before running