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

Re: BUG #1784: "adding missing FROM-clause" when not needed

From: Richard Huxton <dev(at)archonet(dot)com>
To: Giacomo G <matic999(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1784: "adding missing FROM-clause" when not needed
Date: 2005-07-25 14:22:41
Message-ID: 42E4F5B1.7080200@archonet.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Giacomo G wrote:
> 
> But, when i run the same query with the real name of table in the where
> statement I get this:

This isn't the "real name" of the table "t0". It is another reference to 
table "foo", and as such should either raise an error or arrange to 
alter the from-clause to make it valid (which is what happens).

> test=# select * from foo t0 join bar t1 on ( t0.a = t1.c ) where foo.a = 1;
> NOTICE:  adding missing FROM-clause entry for table "foo"
>  a |  b  | c |  d  
> ---+-----+---+-----
>  1 | abc | 1 | ghi
>  2 | def | 2 | jkl
> (2 rows)
> 
> while I expect the same result of the first query.

In recent versions, you can disable the feature in your postgresql.conf 
by setting "add_missing_from" to false. See the manuals - run-time 
environment / compatibility.

--
   Richard Huxton
   Archonet Ltd

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-07-25 14:58:28
Subject: Re: BUG #1784: "adding missing FROM-clause" when not needed
Previous:From: Michael FuhrDate: 2005-07-25 14:16:21
Subject: Re: BUG #1784: "adding missing FROM-clause" when not needed

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