Re: psql: Add tab completion for ALTER USER RESET

Robins Tharakan <tharakan@gmail.com>

From: Robins Tharakan <tharakan@gmail.com>
To: Tomas Vondra <tomas@vondra.me>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-02-15T11:14:04Z
Lists: pgsql-hackers

Attachments

Hi Tomas,

Thanks for taking a look - apologies for the delay here.

On Tue, 10 Dec 2024 at 09:09, Tomas Vondra <tomas@vondra.me> wrote:
>
> 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.
>

+1 - "ALL" is pointless when there is nothing to RESET, but I didn't
find an easy way to make it conditional (which was partly the
cause of delay here). For this, I tried (and not yet successful) to
create a new set of macros - something along the lines of
COMPLETE_WITH_QUERY_IFNOTEMPTY_PLUS() - where
the second part is conditional on whether the query list returns
a non-empty set.

If this is a blocker, I'll continue working on a macro that allows that
more easily (although it'd be great if you could point me to a better
way to implement that). For now, reattached v1 to this email for
convenience.


> 2) Should we do the same thing for ALTER DATABASE? That also allows
> setting options.
>
+1. Attached a separate patch for ALTER DATABASE RESET in case
you think it is good to go alongside (albeit again, this still does show
ALL even if there's no vars to RESET).

-
robins

Commits

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

  2. Add tab completion for ALTER USER/ROLE RESET