Postgres compatiblity fix