Re: [PATCH] Allow complex data for GUC extra.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bryan Green <dbryan(dot)green(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Allow complex data for GUC extra.
Date: 2025-11-21 22:26:52
Message-ID: 1e982524-bdb3-43e5-86be-669b29546ee8@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2025-11-18 Tu 2:56 PM, Robert Haas wrote:
>
> In general, I don't think that whether or not a GUC's parsed value can
> be serialized easily into a single palloc'd chunk is a good measure of
> whether it's too complicated.

+1

> I agree, of course, that we shouldn't
> randomly sandwhich a bunch of disparate values into a single GUC --
> several separate GUCs is better. However, what about a value that
> intrinsically has some internal structure? We originally thought that
> we wanted synchronous_standby_names to just be a list of standbys,
> which barely qualifies as internal structure and so fits with the idea
> of a single palloc'd chunk, but then we decided we wanted to allow
> prefixing that list stuff like ANY 2 or FIRST 3. Does that make it no
> longer suitable to be a GUC? What if we had instead decided to allow
> nested structure, like synchronous_standby_names = a, (b, c), d? That
> definitely isn't nice for a flat structure, but I doubt anyone would
> like it if that adjustment suddenly meant it had to be some other kind
> of thing rather than a GUC, and what would the other thing be, anyway?
>

If GUC A depends for sanity on the value of GUC B, it seems rather odd
to force them to be independent at the grammar level. A structured GUC
would make more sense in such a case.

One of the things that bothers me a bit here is that we seem to be
inventing a bunch of micro-languages to deal with structured GUC data.
<asbestos-mode> Maybe they could all be JSON?</>

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-11-21 22:38:02 Re: Extended test coverage and docs for SSL passphrase commands
Previous Message Corey Huinker 2025-11-21 22:18:59 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions