From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tomas Vondra <tomas@vondra.me>
Cc: jian he <jian.universality@gmail.com>
Cc: Robins Tharakan <tharakan@gmail.com>
Cc: Tomas Vondra <tomas.vondra@postgresql.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Fix tab completion in v18 for ALTER DATABASE/USER/ROLE ... RESET
Date: Thu, 31 Jul 2025 15:21:33 +0100
Message-ID: <87v7n8h24y.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <48d5f407-3bfa-4518-9a73-22d1a6aa0544@vondra.me>
References: <87qzyghw2x.fsf@wibble.ilmari.org>
<CACJufxF5_23CykxYOFYeXMR6_XC+fjjUmY5NRf=JQDWR26q4XA@mail.gmail.com>
<87ecu8iid7.fsf@wibble.ilmari.org>
<54b435ab-ce2a-4a65-b4a9-35633dea2b28@vondra.me>
<875xfahtik.fsf@wibble.ilmari.org>
<48d5f407-3bfa-4518-9a73-22d1a6aa0544@vondra.me>
Tomas Vondra <tomas@vondra.me> writes:
> On 7/30/25 12:17, Dagfinn Ilmari Mannsåker wrote:
>>
>> ...
>>
>>> @@ -5015,7 +5021,8 @@ match_previous_words(int pattern_id,
>>> /* Complete with a variable name */
>>> else if (TailMatches("SET|RESET") &&
>>> !TailMatches("UPDATE", MatchAny, "SET") &&
>>> - !TailMatches("ALTER", "DATABASE", MatchAny, "RESET"))
>>> + !TailMatches("ALTER", "DATABASE", MatchAny, "RESET") &&
>>> + !TailMatches("ALTER", "USER|ROLE", MatchAny, "RESET"))
>>> COMPLETE_WITH_QUERY_VERBATIM_PLUS(Query_for_list_of_set_vars,
>>> "CONSTRAINTS",
>>> "TRANSACTION",
>>
>> Instead of adding another !TailMatches() call, why not just change
>> "DATABASE" to "DATABASE|ROLE|USER"?
>
> It seemed to me separate calls would be easier to understand, but I see
> combine it like this in many other places, so done that way ...
>
> Pushed.
Thanks!
> Thanks for the fixes!
>
> regards
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: ilmari@ilmari.org, tomas@vondra.me, jian.universality@gmail.com, tharakan@gmail.com, tomas.vondra@postgresql.org, pgsql-hackers@lists.postgresql.org
Subject: Re: Fix tab completion in v18 for ALTER DATABASE/USER/ROLE ... RESET
In-Reply-To: <87v7n8h24y.fsf@wibble.ilmari.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox