Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..." - Mailing list pgsql-sql

From Tom Lane
Subject Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..."
Date
Msg-id 19446.1570544970@sss.pgh.pa.us
Whole thread Raw
In response to Re: parser that could handle "FROM... SELECT..." as well as"SELECT... FROM..."  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-sql
Pavel Stehule <pavel.stehule@gmail.com> writes:
> út 8. 10. 2019 v 8:12 odesílatel Marius Andreiana <
> marius.andreiana@gmail.com> napsal:
>> After reading
>> https://jvns.ca/blog/2019/10/03/sql-queries-don-t-start-with-select/
>> and the discussions at https://news.ycombinator.com/item?id=21150606
>> I'd also like to write "FROM... SELECT..." instead of "SELECT... FROM...".

> Personally I don't see any benefit of proposed feature - It breaks
> portability of SQL queries (that is not high today).

The one advantage I could see to this is that, in principle,
it would allow tab-completion in the SELECT list to know
what column names to offer.  Of course, making that actually
work would take a huge amount of effort, since psql's tab
completion "parser" is so lame.

On balance I agree that's not attractive enough to justify the
compatibility gotchas we'd be introducing.  Postgres does have
some intentional deviations from the SQL standard, but they
seem to me to have better justifications than this one.

            regards, tom lane



pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: parser that could handle "FROM... SELECT..." as well as"SELECT... FROM..."
Next
From: Mike Martin
Date:
Subject: Qusetion re regexexp_split_to_array and last occurence