| From: | Tatsuya Kawata <kawatatatsuya0913(at)gmail(dot)com> |
|---|---|
| To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | Soumya S Murali <soumyamurali(dot)work(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: [Patch]Add tab completion for DELETE ... USING |
| Date: | 2026-02-28 04:37:53 |
| Message-ID: | CAHza6qdYj10_sj7L1BsVubw7VkH-YepFXxfNM4jA1cupgDd-Qg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Fujii-san, Soumya-san,
Thank you very much for reviewing and testing my patch!
> 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.
You're absolutely right. Since the USING clause follows the same syntax as
the FROM clause of a SELECT statement,
it should support views and other selectable objects, not just tables.
I've changed it to use Query_for_list_of_selectables.
> 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 ....
I agree with your second point. For consistency with SELECT ... FROM ...
completion behavior,
I think it's better not to suggest anything after USING <table>. This
approach is cleaner
and more consistent with existing patterns.
I've prepared a v4 patch with the following changes:
- Use Query_for_list_of_selectables instead of Query_for_list_of_tables
- Remove the completion for USING <table> to maintain consistency with
SELECT behavior
The updated v4 patch is attached.
Regards,
Tatsuya Kawata
| Attachment | Content-Type | Size |
|---|---|---|
| v4-0001-Add-tab-completion-for-DELETE-USING.patch | application/octet-stream | 2.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nico Williams | 2026-02-28 04:40:53 | Re: [PATCH] Add PQgetThreadLock() to expose the Kerberos/Curl mutex |
| Previous Message | Chao Li | 2026-02-28 03:12:24 | Re: [PATCH] Add PQgetThreadLock() to expose the Kerberos/Curl mutex |