Re: Fix tab completion in v18 for ALTER DATABASE/USER/ROLE ... RESET

Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>

From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tomas Vondra <tomas@vondra.me>
Cc: jian he <jian.universality@gmail.com>, Robins Tharakan <tharakan@gmail.com>, Tomas Vondra <tomas.vondra@postgresql.org>, pgsql-hackers@lists.postgresql.org
Date: 2025-07-31T14:21:33Z
Lists: pgsql-hackers
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



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix tab completion for ALTER ROLE|USER ... RESET

  2. Schema-qualify unnest() in ALTER DATABASE ... RESET