Re: GUC names in messages

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: GUC names in messages
Date: 2024-10-09 09:54:18
Message-ID: ZwZSyv8BpVHRH-K4@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 08, 2024 at 06:57:10PM +1100, Peter Smith wrote:
> As for what is left, I had made just the minimal patch to fix the
> known "IntervalStyle" problem, but that assumed prior knowledge of
> what were the only problem names in the first place. Your way is
> better -- to always use the record name where possible.

Yes, useful for custom GUCs, even if I doubt that many of them mix
character casing these days.

> One thing I thought remains not so good is how
> set_config_with_handle(name...) function does
> record=find_option(name,...) but then all subsequent names are
> supposed to be coming from the record->name. It feels confusing to
> have that parameter 'name' still in scope after the find(), e.g., when
> you should not be using that anymore. So, I tried to separate this
> logic into 2 functions -- set_config_with_handle() and
> set_config_with_handle_guts(). There are no name overlaps now, but I
> wonder if the fix was overkill. See v14.

I was also looking at reducing the scope of the "name" variable in
this path, but that makes IMO the code a bit more confusing with the
existing wrapper set_config_option() and set_config_option_ext(),
while the handle is only used within fmgrs.

Applied the previous patch after looking at it again.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2024-10-09 10:41:02 Re: Changing the state of data checksums in a running cluster
Previous Message Mikael Sand 2024-10-09 09:51:21 Re: Build issue with postgresql 17 undefined reference to `pg_encoding_to_char' and `pg_char_to_encoding'