> prr=# select foo.c1, f.c2 from foo f; -- >>> Incorrect result <<<
>
> The result of the "select foo.c1, f.c2 from foo f" isn't correct, it do
> a cartesian product of foo table.
foo is aliased to f, so there's no table named foo in the from clause.
By default postgres tries to add the missing table name, so your query
get rewritten as:
select foo.c1, f.c2 from foo f, foo;
You should also receive a:
NOTICE: adding missing FROM-clause entry for table "foo"
Best regards
--
Matteo Beccati
http://phpadsnew.com
http://phppgads.com