Re: psql: Add tab completion for ALTER USER RESET

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: Add tab completion for ALTER USER RESET
Date: 2025-02-15 11:14:04
Message-ID: CAEP4nAx2xeR+GiCaOZhEcMdq_5J6yUDd5u5FYGHkfs9ULKd0eA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tomas,

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

On Tue, 10 Dec 2024 at 09:09, Tomas Vondra <tomas(at)vondra(dot)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

Attachment Content-Type Size
v1-0001-Add-tab-completion-for-ALTER-DATABASE-RESET.patch application/x-patch 2.3 KB
v1-0001-Add-tab-completion-for-ALTER-USER-RESET.patch application/x-patch 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2025-02-15 12:33:54 Re: pg17.3 PQescapeIdentifier() ignores len
Previous Message Matthias van de Meent 2025-02-15 10:49:47 Re: Expanding HOT updates for expression and partial indexes