" ::= " grammar rule not accepted by
Postgres
От | Clem Dickey |
---|---|
Тема | " |
Дата | |
Msg-id | OF650DD52B.2DDBF653-ON852578B0.00699C93-882578B0.0077F2AD@us.ibm.com обсуждение исходный текст |
Ответы |
Re: " |
Список | pgsql-sql |
<p><font face="sans-serif" size="2">This expression is (I think) a well-formed query, but is rejected by Postgresql 8.4 (tis a table name).</font><br /><br /><font face="sans-serif" size="2"> t t1 NATURAL JOIN t t2;</font><br /><br /><font face="sans-serif"size="2">Here is the relevant parts of grammar (with some optional elements omitted for simplicity): </font><br/><br /><font face="sans-serif" size="2"> <query expression> ::= <query expression body></font><br/><br /><font face="sans-serif" size="2"> <query expression body> ::= <joined table></font><br/><br /><font face="sans-serif" size="2"> <joined table> ::= <natural join></font><br /><br/><font face="sans-serif" size="2"> <natural join> ::= <table reference> NATURAL JOIN <table primary></font><br/><br /><font face="sans-serif" size="2"> <table reference> ::= <table primary></font><br/><br /><font face="sans-serif" size="2"> <table primary> ::= <table or query name> [ <correlationname> ]</font><br /><br /><font face="sans-serif" size="2"> <table or query name> ::= <table name></font><br/><br /><font face="sans-serif" size="2">Nor is this use of <joined table> accepted in the <queryexpression> form of a <with list element>:</font><br /><br /><font face="sans-serif" size="2"> WITH twAS ( t t1 NATURAL JOIN t t2 ) TABLE tw; </font><br /><br /><font face="sans-serif" size="2">This leads me to believe thatthe unrecognized grammar rule (in SQL99 standard terms) is</font><br /><br /><font face="sans-serif" size="2"> <queryexpression body> ::= <joined table></font><br /><br /><font face="sans-serif" size="2">There are, of course,other ways to express the operation, including</font><br /><font face="sans-serif" size="2"> SELECT * FROM (t t1 NATURALJOIN t t2);</font><br /><font face="sans-serif" size="2">But I am curious why the first expression is not accepted,besides the immediately obvious "it's not in the Postgres version of the SQL grammar."</font><br /><br /><font face="sans-serif"size="2">Clem Dickey</font>
В списке pgsql-sql по дате отправления: