Search Postgresql Archives

OTICE: adding missing FROM-clause entry for table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
Christian Laursen

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux