agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathandbossart@gmail.com>
To: Álvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Nikolay Shaplov <dhyan@nataraj.su>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Chris Travers <chris.travers@gmail.com>
Cc: Timur Magomedov <t.magomedov@postgrespro.ru>
Subject: Re: [PATCH] ternary reloption type
Date: Fri, 16 Jan 2026 15:52:59 -0600
Message-ID: <aWqzOzaWf19oJVQw@nathan> (raw)
In-Reply-To: <202601161509.54de2afpgxpp@alvherre.pgsql>
References: <4047390.3Lj2Plt8kZ@thinkpad-pgpro>
<202601161509.54de2afpgxpp@alvherre.pgsql>
On Fri, Jan 16, 2026 at 04:14:52PM +0100, Álvaro Herrera wrote:
> I'm CCing Nathan as committer of the vacuum_truncate_set stuff which
> Nikolay so strongly disliked. Any objections to going with this
> approach?
Looks generally reasonable.
> This could also be used for other options such as `vacuum_index_cleanup`
> and `buffering`, but lets get the scaffolding in first.
Part of me wonders if we should just modify the Boolean relopt
implementation instead of using ternary only when needed.
> + parsed = parse_bool(value, &b);
> + option->values.ternary_val = b ? TERNARY_TRUE : TERNARY_FALSE;
> + if (validate && !parsed)
> + ereport(ERROR,
> + (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> + errmsg("invalid value for ternary option \"%s\": %s",
> + option->gen->name, value)));
Shouldn't this say "invalid value for boolean option"? IIUC the intent is
for ternary to be exactly like bool, except it defaults to an "unset" value
that can't be chosen by the user. In that sense, I think "ternary" is kind
of a misnomer, but I wouldn't count this as an objection.
--
nathan
view thread (13+ messages) latest in thread
Message-ID: <aWqzOzaWf19oJVQw@nathan>
Permalink: ../aWqzOzaWf19oJVQw@nathan/
Also on: postgresql.org/message-id/aWqzOzaWf19oJVQw@nathan
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, alvherre@alvh.no-ip.org, dhyan@nataraj.su, pgsql-hackers@lists.postgresql.org, chris.travers@gmail.com, t.magomedov@postgrespro.ru
Subject: Re: [PATCH] ternary reloption type
In-Reply-To: <aWqzOzaWf19oJVQw@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox