> One thing that I always have to remind myself of is this:
>
> string || NULL is NULL.
> It is usually a good idea to use coalesce() unless you want this to
> happen.
>
See my recent post at
http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id=24725
(and in general, everyone here who hasn't looked at
http://www.brasileiro.net/postgres/cookbook/
should review all the great goodies posted there).
~Berend Tober