Re: [PATCH] Proof of concept for GUC improvements

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: David Christensen <david(dot)christensen(at)crunchydata(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Proof of concept for GUC improvements
Date: 2021-08-19 22:30:31
Message-ID: d4cbcb3a-41b6-4f4d-7f7c-f25954ccfa20@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/20/21 12:09 AM, David Christensen wrote:
> -hackers,
>
> Enclosed, find a POC patch that implements "special values" for int GUCs. We have quite a few GUCs
> with values that have special meaning atop other settings. I have attempted to identify these and
> make it so you can specify a symbol name for these values instead of just relying on the magic
> number instead.
>
> For instance, many GUCs have -1 for "disabled", so I've just made it so you can
> specify something like:
>
> SET log_min_duration_statement = disabled;
>
> And the raw value will be set to -1 in this case. For the purposes of testing, I have also added a
> new GUC "output_special_values" to affect whether `SHOW` or anything that relies on _ShowOption()
> can show with the special value instead of just the raw magic value, allowing tools to consume the
> original raw value, or provide the output to the user in the nicer format.
>
> This has only been done for ints, and the passthru I did was very quick, so I have probably missed
> some options that didn't explicitly have their interpretations in the file and/or I didn't know
> about it already. I do not think there are these sorts of values in other non-int GUCs, but there
> might be, so a similar approach could be taken to expand things to other config types in the future.
>
> Let me know your thoughts; I personally find this to be useful, and would be a nicer way for some
> configs to be displayed in the postgresql.conf file.

As discussed on IRC, I am in favor of this improvement. (I have not yet
looked at the patch.)
--
Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-08-19 22:31:09 Silliness in regexp's citerdissect/creviterdissect
Previous Message David Christensen 2021-08-19 22:09:25 [PATCH] Proof of concept for GUC improvements