Here's another anomaly I've run across in porting the Ars Digita
Community System web development toolkit from Oracle to Postgres:
In oracle, if we do:
SQL> create table foo(i integer, j integer);
Table created.
then select like this, we get no rows returned:
SQL> select i, count(*) from foo group by i;
no rows selected
In postgres, the same select on the same empty table yields:
test=> select i, count(*) from foo group by i;
i|count
-+-----| 0
(1 row)
test=>
Which is correct? It's the count() causing the row to be output,
apparently PostgreSQL feels obligated to return at least one
value for the aggragate and since there are no groups has to
invent one. I assume this is wrong, and that Oracle's right, but
haven't dug through Date's book to verify.
- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.