Unable to connect Postgis from QGIS 1.8.0

I am not sure if it matters, but for me, Postgis 1.5 and Postgres 9.0 (x86) are talking to QGIS 1.8.0 without problems.

QGIS is still 32-bit, even on Windows 7 64-bit machines. Give the x86 version a try, and the old postgis version.


You must confirm the database is PostGIS not PostGres

Go to pgAdmin and view your database. Open and view the DB and besides "Schemas" there will be a count of schemas available. If it says "Schemas (1)" it's probably only a PostGres DB. Inside "Schemas" there should be an entry for "topology." If there is no topology it is not a spatial database (PostGIS) and therefore will not be visible in QGIS.


I had this problem recently as well. What worked for me is:

  1. leaving the host field blank. "localhost" refers to connecting to your local machine via IP, which I don't believe is what you want.
  2. look in your postgresql.conf file for

    listen_addresses = '*'      # what IP address(es) to listen on;
    

    and make sure that it is an '*', this will ensure it can find your local connection

  3. check your pg_hba.conf file and make sure your authentication permissions are set correctly for the "local" entry

Edit: Here's a link to my similar question on Database Administrators.