Richard,
> I think this is the "adding a table into the FROM" feature of PG. You're
> referring to documents.xxx in the select and d.id in the FROM. PG tries to
> help out by adding the table into the FROM for you - hence cartesian join.
Aha! You're right.
> I think you can turn this "feature" off in the config file in 7.3.x (haven't
> checked this though)
Nope, it's a 7.4 feature to turn it off in .conf. Look under the
"compatibility" section (the last section) in 7.4's postgresql.conf.
--
-Josh Berkus
Aglio Database Solutions
San Francisco