Wrapper for PHP's pgsql extension providing conversion of complex DB types