Re: psql: Add tab completion for ALTER USER RESET - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: psql: Add tab completion for ALTER USER RESET
Date
Msg-id 0259c197-4f63-4840-b82b-d9e4eca590a3@vondra.me
Whole thread Raw
List pgsql-hackers
Hi,

On 11/29/24 09:42, Robins Tharakan wrote:
> Hi,
> 
> Please find attached a patch to help tab completion show only currently
> set vars
> during ALTER USER RESET.
> 
> Currently tab completion provides a list of all vars which is only
> partially helpful.
> This patch allows tab completion to see which vars are currently set for
> the role
> and only show those options during tab completion.
> 

Yeah, this looks convenient. Without the patch we'd get

...
Display all 200 possibilities? (y or n)

and then a wall of text with all the options. With the patch we get only
options that are actually set for the user, which is much better.

Two comments:

1) Does it make sense to still show "ALL" when the query returns
nothing? Not sure if we already have a way to handle this.

2) Should we do the same thing for ALTER DATABASE? That also allows
setting options.


thanks

-- 
Tomas Vondra




pgsql-hackers by date:

Previous
From: Michael Harris
Date:
Subject: Re: FileFallocate misbehaving on XFS
Next
From: Michael Harris
Date:
Subject: Re: FileFallocate misbehaving on XFS