Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f153dux46126 for ; Sun, 4 Feb 2001 22:39:56 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f153dp907824; Sun, 4 Feb 2001 22:39:51 -0500 (EST) To: "Josh Berkus" cc: pgsql-sql@postgresql.org Subject: Re: JOIN chaining not working in 7.1 beta 3 In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Sun, 04 Feb 2001 17:10:07 -0800" Date: Sun, 04 Feb 2001 22:39:51 -0500 Message-ID: <7821.981344391@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200102/37 X-Sequence-Number: 1205 "Josh Berkus" writes: > And I get: > ERROR: JOIN/ON CLAUSE REFERS TO 'c' WHICH IS NOT PART OF > JOIN. > What's wrong here? I don't believe you transcribed your query accurately. My attempt to replicate the complaint works fine: nic=# create table a (one int, two int); CREATE nic=# create table b (two int, three int); CREATE nic=# create table c (two int); CREATE nic=# select a.one, b.two, c.two nic-# FROM a INNER JOIN b ON a.one = b.three nic-# LEFT OUTER JOIN c on a.one = c.two; one | two | two -----+-----+----- (0 rows) I can get the same error message with: nic=# select a.one, b.two, c.two nic-# FROM a INNER JOIN b ON a.one = c.two nic-# LEFT OUTER JOIN c on a.one = c.two; NOTICE: Adding missing FROM-clause entry for table "c" ERROR: JOIN/ON clause refers to "c", which is not part of JOIN which is correct since the a/b join should have a join condition that refers only to a and b. regards, tom lane