On Sat, Feb 28, 2026 at 1:38 PM Tatsuya Kawata
<kawatatatsuya0913@gmail.com> wrote:
>
> 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.
Thanks for updating the patch!
+ /* Complete DELETE FROM <table> USING with a list of selectables */
Would it be better to use "relations supporting SELECT" instead of
"selectables"? That wording is used in other tab-completion comments that
reference Query_for_list_of_selectables, so it might be better to stay
consistent.
As for the regression test, I agree with Kirill. I don't think it's necessary
to add a separate test for this specific tab-completion case. The existing
tests already cover tab-completion patterns based on
Query_for_list_of_selectables following specific keywords, which should be
sufficient.
Regards,
--
Fujii Masao