Re: Improve tab completion for various SET/RESET forms

From: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improve tab completion for various SET/RESET forms
Date: 2025-08-08 03:03:30
Message-ID: CAOzEurSWaiE7pHhATgxMn2ok5PyQd_C+m=3TFUUmkdbTXRZLMw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 1, 2025 at 2:16 AM Dagfinn Ilmari Mannsåker
<ilmari(at)ilmari(dot)org> wrote:
>
> Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> writes:
>
> > I just noticed that in addition to ALTER ROLE ... RESET being buggy, the
> > ALTER DATABASE ... RESET query doesn't schema-qualify the unnest() call.
> > Here's an updated patch series that fixes that too. The first two are
> > bug fixes to features new in 18 and should IMO be committed before
> > that's released. The rest can wait for 19.
>
> Now that Tomas has committed the two bugfixes, here's the rest of the
> patches rebased over that.

Thank you for the patches.

+ else if (Matches("ALTER", "FOREIGN", "TABLE", MatchAny, "SET"))
+ COMPLETE_WITH("SCHEMA");

In addition to SET SCHEMA, I think you should add tab completion for
SET WITHOUT OIDS.

+#define Query_for_list_of_session_vars \
+"SELECT pg_catalog.lower(name) FROM pg_catalog.pg_settings "\
+" WHERE context IN ('user', 'superuser') "\
+" AND source = 'session' "\
+" AND pg_catalog.lower(name) LIKE pg_catalog.lower('%s')"

I think the context IN ('user', 'superuser') condition is redundant
here. If a parameter's source is 'session', its context must be either
'user' or 'superuser'. Therefore, the source = 'session' check alone
should be sufficient.

--
Best regards,
Shinya Kato
NTT OSS Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-08-08 03:17:11 Re: Conflict detection for update_deleted in logical replication
Previous Message Yugo Nagata 2025-08-08 02:51:42 Align tests for stored and virtual generated columns