public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thom Brown <[email protected]>
To: Álvaro Herrera <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: Baji Shaik <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Fix psql tab completion for REPACK boolean options
Date: Mon, 18 May 2026 13:29:23 +0100
Message-ID: <CAA-aLv57ymRoDJ+2UnHCE7WDB_FH5pW9+bFX7z5wEegudPrdRQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAA-aLv79Gs3daW-=+invvemr5nxBzHm9Kn=DAC21qj8YWvQ1pw@mail.gmail.com>
	<[email protected]>

On Mon, 18 May 2026 at 12:49, Álvaro Herrera <[email protected]> wrote:
>
> On 2026-May-18, Thom Brown wrote:
>
> > I saw this just got committed. Is there a reason the option handling
> > for this, VACUUM, and EXPLAIN aren't done in one place?
>
> I don't think they take exactly the same options; but if you see room
> for improvement, by all means send a patch.

I wasn't thinking of a shared handler for the options themselves,
because, as you say, those differ per command. I meant the handling of
the DefElem list: last-duplicate-wins, rejecting unknown options,
coercion via defGetBoolean, etc. That part is the same everywhere, but
each command writes its own set of checks, and the bug fixed here is
what you get from that: a loop that enabled the option if any
occurrence was ON, instead of just overwriting.
So each command would hand its DefElem list to a common routine along
with a table of valid option names and types. The routine iterates the
list, rejects unknown names, coerces values, and applies last-wins for
repeated options. Command-specific semantic checks would stay in the
command.

I could try writing a patch, but at this point in the dev cycle, it's
probably something for later.

Thom






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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Fix psql tab completion for REPACK boolean options
  In-Reply-To: <CAA-aLv57ymRoDJ+2UnHCE7WDB_FH5pW9+bFX7z5wEegudPrdRQ@mail.gmail.com>

* 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