pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Clem Dickey <dickeycl@us.ibm.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: "<query expression body> ::= <joined table>" grammar rule not accepted by Postgres
Date: Thu, 16 Jun 2011 01:59:12 -0400
Message-ID: <19449.1308203952@sss.pgh.pa.us> (raw)
In-Reply-To: <OF650DD52B.2DDBF653-ON852578B0.00699C93-882578B0.0077F2AD@us.ibm.com>
References: <OF650DD52B.2DDBF653-ON852578B0.00699C93-882578B0.0077F2AD@us.ibm.com>

Clem Dickey <dickeycl@us.ibm.com> writes:
> This expression is (I think) a well-formed query, but is rejected by
> Postgresql 8.4 (t is a table name).

>   t t1 NATURAL JOIN t t2;

Hmm ... I think you are looking at SQL92 or SQL99.  The later versions
of the spec don't seem to permit <joined table> to be used that way.
In particular, in SQL:2003 and SQL:2007 I don't see any derivation path
from <query expression> to <joined table>.  So while we possibly could
support this, it's legacy syntax, and I doubt there's enough interest to
bother.

[ digs a bit more... ]  Ah, here we are: Annex E of SQL:2003 calls out
various incompatibilities from SQL:99, notably

	6) In ISO/IEC 9075-2:1999, a <query expression body>, <query
	term>, or <query primary> could consist of a <joined
	table>. None of those three elements can consist of a <joined
	table> in this edition of ISO/IEC 9075.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <19449.1308203952@sss.pgh.pa.us>
Permalink:  ../19449.1308203952@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19449.1308203952@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dickeycl@us.ibm.com
  Subject: Re: "<query expression body> ::= <joined table>" grammar rule not accepted by Postgres
  In-Reply-To: <19449.1308203952@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox