Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..."

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Marius Andreiana <marius(dot)andreiana(at)gmail(dot)com>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..."
Date: 2019-10-08 06:32:01
Message-ID: CAFj8pRCsrM=2=Tz0=PGHntcWFSNV4ig4kxdY4sSRQ0M0t1QVhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi

út 8. 10. 2019 v 8:12 odesílatel Marius Andreiana <
marius(dot)andreiana(at)gmail(dot)com> napsal:

> Hello Postgres folks,
>
> 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...".
>

This article is little bit strange, it mix syntax and execution together

>
> Postgres doesn't support this though. Would it be possible to please add
> parsing support for this syntax as well?
>

PostgreSQL supports ANSI/SQL. ANSI/SQL doesn't allow use clauses in any
order.

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

Regards

Pavel

> Somebody mentioned:
> Engines don’t run sql directly. They make an AST, make an intermediate
> representation of instructions and then execute.
> So if it results in same AST, the parser should be flexible.
>

> Thanks!
> Marius
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Marius Andreiana 2019-10-08 07:14:11 Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..."
Previous Message Marius Andreiana 2019-10-08 06:12:15 parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..."