Merge PostgreSQL fixes