Re: pg_settings.unit and DefineCustomXXXVariable

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_settings.unit and DefineCustomXXXVariable
Date: 2025-01-08 10:32:10
Message-ID: CAEze2Wi78zon+N51HN1km=ZiazZKuZKo2zOccVgjxT-6K=fP7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 8 Jan 2025 at 11:13, Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:
>
> Hi all,
> I need to define a few GUCs, and for that purpose I'm using
> DefineCustomXXXVariable functions that provide hooks for assignment,
> show and check. However it is not clear to me if it is possible to
> populate the unit column in pg_settings for the custom defined
> variables, and if so, how.

DefineCustomXXXVariable has a 'flags' argument, into which GUC_UNIT_*
can be or-ed.
AFAIK, the options provided in guc.h are the only kinds of units
supported and available, and I think only integer variables actually
support the unit conversion implied by the unit options.

Kind regards,

Matthias van de Meent

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-01-08 10:33:05 Re: Conflict detection for update_deleted in logical replication
Previous Message Luca Ferrari 2025-01-08 10:12:16 pg_settings.unit and DefineCustomXXXVariable