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

From: Michael Fuhr <mike(at)fuhr(dot)org>
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:16:21
Message-ID: 20050725141620.GA35208@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jul 25, 2005 at 03:03:54AM +0100, Giacomo G wrote:
> But, when i run the same query with the real name of table in the where
> statement I get this:
>
> 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"

See the SELECT documentation:

http://www.postgresql.org/docs/8.0/static/sql-select.html

"When an alias is provided, it completely hides the actual name of
the table or function; for example given FROM foo AS f, the remainder
of the SELECT must refer to this FROM item as f not foo."

If you disable add_missing_from then you'll get an error instead
of a notice and unexpected results. Add_missing_from will be
disabled by default in PostgreSQL 8.1.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Huxton 2005-07-25 14:22:41 Re: BUG #1784: "adding missing FROM-clause" when not needed
Previous Message K.G.Sivaraman 2005-07-25 11:36:43 BUG #1785: Return code !!!