| From: | Denis Smirnov <darthunix(at)gmail(dot)com> |
|---|---|
| To: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
| Cc: | Vik Fearing <vik(at)postgresfriends(dot)org>, pgsql-hackers mailing list <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andreas Karlsson <andreas(at)proxel(dot)se> |
| Subject: | Re: FROM clause before SELECT |
| Date: | 2026-07-30 04:12:39 |
| Message-ID: | 8092B28C-07B7-419F-9769-E89850D2D843@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
If the main motivation is better completion, with compatibility with
DuckDB and ClickHouse as an additional benefit, v1 seems like the
better choice.
With v1, FROM establishes the relation scope before SELECT, allowing
psql to complete input columns. The select list then defines output
aliases before GROUP BY and ORDER BY, where PostgreSQL permits those
aliases. This gives us another useful completion opportunity. v2 loses
this property for GROUP BY.
v1 also matches the existing FROM-first syntax in DuckDB and
ClickHouse.
I think we should also test completion with JOINs: multiple relations,
table aliases, qualified columns, ON/USING, and target-list columns
from both sides. The current rules seem mostly centered on a single
relation.
Best regards,
Denis Smirnov
| From | Date | Subject | |
|---|---|---|---|
| Next Message | chee.wooson | 2026-07-30 04:20:14 | Re: [PATCH v2] Fix exported snapshot xmin handoff race |
| Previous Message | David Rowley | 2026-07-30 03:46:53 | Re: Partition pruning can incorrectly exclude a RANGE default partition |