Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHqUg-0006Y0-0T for pgsql-sql@arkaria.postgresql.org; Tue, 08 Oct 2019 14:29:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHqUe-0003AB-Eb for pgsql-sql@arkaria.postgresql.org; Tue, 08 Oct 2019 14:29:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHqUe-00039t-39 for pgsql-sql@lists.postgresql.org; Tue, 08 Oct 2019 14:29:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iHqUZ-0001LW-R1 for pgsql-sql@lists.postgresql.org; Tue, 08 Oct 2019 14:29:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x98ETULg019447; Tue, 8 Oct 2019 10:29:31 -0400 From: Tom Lane To: Pavel Stehule cc: Marius Andreiana , pgsql-sql@lists.postgresql.org Subject: Re: parser that could handle "FROM... SELECT..." as well as "SELECT... FROM..." In-reply-to: References: Comments: In-reply-to Pavel Stehule message dated "Tue, 08 Oct 2019 08:32:01 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <19445.1570544970.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 08 Oct 2019 10:29:30 -0400 Message-ID: <19446.1570544970@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Stehule 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