Improved PostgreSQL setup