Received: from mail1.waterford.org (mail1.waterford.org [205.124.117.6]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7HI38P90730 for ; Fri, 17 Aug 2001 14:03:08 -0400 (EDT) (envelope-from olebedev@waterford.org) Received: from waterford.org ([205.124.117.234]) by mail1.waterford.org (Netscape Messaging Server 3.56) with ESMTP id 302; Fri, 17 Aug 2001 11:54:14 -0600 Message-ID: <3B7D6048.530CCD96@waterford.org> Date: Fri, 17 Aug 2001 12:19:52 -0600 From: Oleg Lebedev X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: Josh Berkus , pgsql-sql@postgresql.org Subject: Re: Nested JOINs - upgrade to 7.1.2 References: <25972.997999951@sss.pgh.pa.us> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Archive-Number: 200108/230 X-Sequence-Number: 4462 I think Tom was right and the problem with nested joins is caused by the outdated installation of my PostgreSQL. So, I am trying to upgrade to 7.1.2 and when I use: pg_dumpall -o > file.bac I get an error saying: dumpRules(): SELECT failed for table setmedias. Explanation from backend: 'ERROR: cache lookup of attribute 5 in relation 23945 failed" As I understand setmedias table corresponds to relation 23945, but I dropped it a long time ago. How should remove this relation pointer? thanks, Oleg Tom Lane wrote: > "Josh Berkus" writes: > > Second, you can't alias a JOINed set of tables; > > Actually you can, according to my reading of SQL92: > > ::= >
[ [ AS ] > [ ] ] > | [ AS ] > [ ] > | > > ::=
> >
::= > > ::= > > ::= > > | > > ::= > > | > | > > ::= >
[ NATURAL ] [ ] JOIN >
[ ] > > So a parenthesized is a and may > be followed by [ AS ] . > > 7.1 gets this right. 7.0's very preliminary implementation of JOIN > syntax did not. (It had a number of other bugs too, IIRC.) > > The spec's grammar is horribly badly written: it's ambiguous whether the > parentheses should be parsed as part of a second-level > which would imply that a correlation name would NOT be accepted. > It took a fair amount of work to derive a grammar that was unambiguous > and still accepted everything... > > regards, tom lane