More PostgreSQL fixes