UDF for postgresql 8.x, greenplum 4.2.x