Reviewed rcommon (Marsupial) code to avoid some problems with PostgreSQL (patch reported by UPCnet)