Stefan,
> To simplify this operation you could create an operator that does
> the coalesce for you. This has come up recently; search the list
> archives for examples.
Actually, it's on General Bits:
http://www.varlena.com/varlena/GeneralBits/84.php
--
Josh Berkus
Aglio Database Solutions
San Francisco