X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 026AE9FB368 for ; Wed, 23 Aug 2006 15:29:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 37097-02 for ; Wed, 23 Aug 2006 18:28:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 2C8949FB346 for ; Wed, 23 Aug 2006 15:28:43 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 23 Aug 2006 18:28:36 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 23 Aug 2006 13:28:36 -0500 Subject: Re: SQL92 compliance From: Scott Marlowe To: Tom Lane Cc: Peter Eisentraut , pgsql-sql@postgresql.org, Daniel CAUNE In-Reply-To: <22448.1156354816@sss.pgh.pa.us> References: <000301c6c655$0e3a0100$0b00a8c0@tedy> <200608231811.48538.peter_e@gmx.net> <22448.1156354816@sss.pgh.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1156357716.7223.23.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 23 Aug 2006 13:28:36 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: *** X-Archive-Number: 200608/167 X-Sequence-Number: 26125 On Wed, 2006-08-23 at 12:40, Tom Lane wrote: > Peter Eisentraut writes: > > Am Mittwoch, 23. August 2006 03:40 schrieb Daniel CAUNE: > >> Is AS in "SELECT my_column AS my_name FROM my_table" mandatory to be SQL92 > >> compliant? > > > No. I have a patch at > > > > that fixes this at least for 7.4. > > I think it's a big stretch to say that that patch fixes it, since it > only allows an AS-less target expression to be c_expr rather than > a_expr as it ought to. > > The problem is really insoluble given that we allow user-defined > postfix operators: is "SELECT x ~~ y" meant to be an infix operator > with arguments x and y, or a postfix operator with argument x and > a column label y? > > When this has come up in the past, we've always concluded that > compliance with this not-very-well-thought-out detail of the spec > is not worth the price of giving up postfix operators. > > Even if we were willing to do that, I think we'd also have to give > up using bison to generate the parser :-( because some constructs > would require more than one-token lookahead. Would it be possible if we required postfix operators and related to be inside parens? select x ~~ y as yabba OR select (x ~~ y) yabba Not that I'd want that. I prefer it the way it is too. Just more of an intellectual exercise.