pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: JOIN chaining not working in 7.1 beta 3
Date: Sun, 04 Feb 2001 22:39:51 -0500
Message-ID: <7821.981344391@sss.pgh.pa.us> (raw)
In-Reply-To: <web-1186399@davinci.ethosmedia.com>
References: <web-1186399@davinci.ethosmedia.com>

"Josh Berkus" <josh@agliodbs.com> 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



view thread (2+ messages)

Message-ID: <7821.981344391@sss.pgh.pa.us>
Permalink:  ../7821.981344391@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7821.981344391@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: JOIN chaining not working in 7.1 beta 3
  In-Reply-To: <7821.981344391@sss.pgh.pa.us>
  References: <web-1186399@davinci.ethosmedia.com> <7821.981344391@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