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

From: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>
To: Christian Laursen <christian(at)pil(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: OTICE: adding missing FROM-clause entry for table
Date: 2005-08-12 08:39:09
Message-ID: 20050812083909.GA1770@isis.sigpipe.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

# christian(at)pil(dot)dk / 2005-08-12 10:17:50 +0200:
> I just experienced some bad SQL causing quite unexpected results.
>
> I used a statement like this:
> SELECT t1.a, t1.b, t2.d FROM test1 t1, test2 t2 WHERE t1.a = test2.a;
>
> Where I should have used this instead:
> SELECT t1.a, t1.b, t2.d FROM test1 t1, test2 t2 WHERE t1.a = t2.a;
>
> When I looked into it and tried it from psql, I got this notice:
> NOTICE: adding missing FROM-clause entry for table "test2"
>
> Now, I understand that postgresql is adding "test2" to the list of
> tables, I am selecting from as it is missing. However the result
> is quite different from what I expected.
>
> Is there a way to change this behaviour to generate an error instead
> of just a notice?

set add_missing_from = false in postgresql.conf

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-08-12 08:41:55 Re: OTICE: adding missing FROM-clause entry for table
Previous Message Christian Laursen 2005-08-12 08:17:50 OTICE: adding missing FROM-clause entry for table