Re: NOTICE: adding missing FROM-clause entry for table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Kumar S <ps_postgres(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: NOTICE: adding missing FROM-clause entry for table
Date: 2004-09-28 02:53:45
Message-ID: 20040928025345.GA83329@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Sep 27, 2004 at 06:51:14PM -0700, Kumar S wrote:

> I am creating a temporary table from an existing table
> and I get the following error. I havent defined any
> relationship between these two tables. Althought I got
> the result what i wanted but I did not understand the
> NOTICE that compiler gives.
>
> => select DISTINCT *,*,*,*,*,*,*,* INTO temp_table
> FROM <existing table1> where * =
> table2.table_2_colName;

It would be helpful to see the actual SQL statements you're running
instead of a simplified example such as the above, which forces the
reader to make assumptions that might not be true. But in this case
I think we get the idea.

> NOTICE: adding missing FROM-clause entry for table
> "probe_set"

You've referenced the table probe_set (presumably what the example
refers to as table2) but you didn't put it in the FROM clause, so
PostgreSQL added it for you. Some people prefer this to raise an
error instead of a warning, so they turn off the add_missing_from
configuration parameter.

http://www.postgresql.org/docs/7.4/static/runtime-config.html#RUNTIME-CONFIG-COMPATIBLE

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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Guerin 2004-09-28 04:28:42 cache lookup failed for relation
Previous Message Kumar S 2004-09-28 02:11:57 Duplicate entries with different primary keys (SERIAL)