bsdconv() for PostgreSQL