[GIS] Why does QGIS not connect to the new local PostGIS database

postgispostgresqlqgis

I'm trying to connect to a new local PostGIS instance (PostgreSQL.app on mac) with QGIS 2.0, and it gives general connection errors.

Connection with same parameters with other clients (psql, PGAdmin) is ok, with both socket and port, so it can't be server configuration?

Best Answer

After wasting several hours it turns out that QGIS cannot connect to an empty database, and Postgres.app ships with one.

Solution was to initialize PostGIS in the database in psql with create extension postgis;

and then connection was successful.