Some PostgreSQL improvements