Re: pgsql: Add vacuum_truncate configuration parameter. - Mailing list pgsql-committers

From David G. Johnston
Subject Re: pgsql: Add vacuum_truncate configuration parameter.
Date
Msg-id CAKFQuwbA6-fXn6w5mS_k5_UOS67+0ogt_FyjpbXFnQaAPm98bA@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Add vacuum_truncate configuration parameter.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Thursday, March 20, 2025, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Nathan Bossart <nathan@postgresql.org> writes:
> Since there's presently no way to determine whether a Boolean
> storage parameter is explicitly set or has just picked up the
> default value, this commit also introduces an isset_offset member
> to relopt_parse_elt.

Uh, what?  Why is it a good idea to distinguish those states?
Seems like that risks some very surprising behavior, ie if the
default is "true", why shouldn't that act exactly like an
explicit setting of "true"?

In order to implement what amounts to coalesce(…) for settings (use global value unless the table value overrides) one needs a sentinel value that means unset because settings cannot take on the null value.  There is no such possible sentinel value for boolean so another field is required.  The hazards of choosing Boolean instead of text for settings.

David J.

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Add vacuum_truncate configuration parameter.
Next
From: Nathan Bossart
Date:
Subject: pgsql: Add test for pg_upgrade file transfer modes.