Re: Improve tab completion for various SET/RESET forms - Mailing list pgsql-hackers

From Shinya Kato
Subject Re: Improve tab completion for various SET/RESET forms
Date
Msg-id CAOzEurSWaiE7pHhATgxMn2ok5PyQd_C+m=3TFUUmkdbTXRZLMw@mail.gmail.com
Whole thread Raw
In response to Re: Improve tab completion for various SET/RESET forms  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Responses Re: Improve tab completion for various SET/RESET forms
List pgsql-hackers
On Fri, Aug 1, 2025 at 2:16 AM Dagfinn Ilmari Mannsåker
<ilmari@ilmari.org> wrote:
>
> Dagfinn Ilmari Mannsåker <ilmari@ilmari.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



pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Align tests for stored and virtual generated columns
Next
From: shveta malik
Date:
Subject: Re: Conflict detection for update_deleted in logical replication