Re: [PATCH] Introduce unified support for composite GUC options

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Чумак Антон <a(dot)chumak(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Introduce unified support for composite GUC options
Date: 2025-09-23 04:39:28
Message-ID: CAFj8pRB48_R=fHPStykoq5To8JAOwgZvS1ddGDAuMMLkMJKw0w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

út 23. 9. 2025 v 6:33 odesílatel Чумак Антон <a(dot)chumak(at)postgrespro(dot)ru>
napsal:

> >when you use json, then what is the benefit from your patch?
>
> json is just a syntax. This is only part of the patch. The main feature is
> that we can directly, in a standard way, without the efforts of developers,
> translate composite values from user interfaces like psql or
> postgresql.conf into structures in C code. With this patch, the
> configuration system gains the ability to correctly manage the state of
> composite objects. This is important when you need to change 2 out of 5
> fields at the same time so that the structure remains consistent. In
> addition, the new configuration module takes over the management of
> resources within the framework, which can be important for strings and
> dynamic arrays. There are other auxiliary features like hidden fields.
>
How common are composites in configuration? It goes against the simplicity
of configuration.

And if you really need it - you can use plpgsql code and set_config
function.

>
> >It is not too big difference if I set value by SET command or by SELECT
> set_config()
>
> Working with parameters is not limited to working within a session,
> otherwise the PGC_INTERNAL, PGC_POSTMASTER, and PGC_SIGHUP contexts would
> not be needed. My patch provides unified support for composite types and
> within such contexts. Example: you have a composite boot value and in the
> postgresql.conf file you need to change only 2 fields, and you need to do
> this at the same time to maintain the consistency of the structure. Now you
> would have to describe all the fields in one big line, and with the patch
> you can only describe the changed fields.
>
your patch does just parsing. At the end, you still need to validate values.

>
> Best regards
>
> Anton Chumak
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-09-23 04:50:45 Re: [PATCH] Introduce unified support for composite GUC options
Previous Message Чумак Антон 2025-09-23 04:33:16 Re: [PATCH] Introduce unified support for composite GUC options