Skip site navigation (1) Skip section navigation (2)

Re: Bug in 7.1.3 and 7.2?

From: Grant Johnson <grant(at)amadensor(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: hs(at)cybertec(dot)at, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug in 7.1.3 and 7.2?
Date: 2001-11-09 17:11:15
Message-ID: 3BEC0E33.4060401@amadensor.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Ooh, ooh, pick me.  I know what happened!!!!!!!

The actual table for a was selected.  The alias for be was selected (d). 
 The where clause involved a and b, not a and d.  Notice that it added 
the missing from clauses?  Well, since the where clause did not apply 
(it applied only to a joining to b, but you selected a and d) it simply 
joined every row in a to every row in d, just like it should have.  You 
can use this to create an alias to a table and then join it to itself. 
 If this behavoir was not like this, it would not allow this added 
functionality.

Make sure that your tables selected from and your where clause match.

> test=# select a.*, d.* from a as c, b as d where a.id=b.id;
> NOTICE:  Adding missing FROM-clause entry for table "a"
> NOTICE:  Adding missing FROM-clause entry for table "b"
>  id | id
> ----+----
>   3 |  3
>   3 |  3
>   3 |  3
>   3 |  4
>   3 |  4
>   3 |  4
> (6 rows)
>
> Althoug c and d are aliases for a and b, the two tables are added to the
> list in the from clause. Is this the desired behaviour or is it a bug?




In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-11-09 17:16:39
Subject: Re: Bug #512: outer join bug
Previous:From: Stephan SzaboDate: 2001-11-09 16:03:22
Subject: Re: Bug #512: outer join bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group