Re: [Patch]Add tab completion for DELETE ... USING - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [Patch]Add tab completion for DELETE ... USING
Date
Msg-id CAHGQGwE-kA193WNARjFPpKXqMKQ4nsK_+dBt4ADwFrtVteofaw@mail.gmail.com
Whole thread Raw
In response to Re: [Patch]Add tab completion for DELETE ... USING  (Soumya S Murali <soumyamurali.work@gmail.com>)
Responses Re: [Patch]Add tab completion for DELETE ... USING
List pgsql-hackers
On Mon, Feb 16, 2026 at 7:44 PM Soumya S Murali
<soumyamurali.work@gmail.com> wrote:
>
> Hi all,
>
> Thank you for the updated patch.
>
> On Mon, Feb 16, 2026 at 10:06 AM Tatsuya Kawata
> <kawatatatsuya0913@gmail.com> wrote:
> >
> > Hi Kirill-san,
> >
> > Thank you for your review and for updating the CF entry status!

Since this patch is marked ready-for-committer, I've started reviewing it.

+ /* Complete DELETE FROM <table> USING with a list of tables */
+ else if (TailMatches("DELETE", "FROM", MatchAny, "USING"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables);

Should this use Query_for_list_of_selectables instead of
Query_for_list_of_tables? The USING clause can reference not only tables
but also views and other selectable objects. The documentation also says
that USING follows the same syntax as the FROM clause of a SELECT.

+ /* Complete DELETE FROM <table> USING <table> */
+ else if (TailMatches("DELETE", "FROM", MatchAny, "USING", MatchAny))
+ COMPLETE_WITH("AS", "WHERE");

Since multiple objects can follow USING, showing only AS and WHERE immediately
after USING <table> feels a bit odd. Also, if we want to support this
completion here, shouldn't RETURNING also be included?

That said, since tab-completion for SELECT ... FROM ... does not suggest
anything at that point, I would also be fine with not suggesting anything for
DELETE ... USING ....

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Row pattern recognition
Next
From: Chao Li
Date:
Subject: Re: Unicode update and some tooling improvements