I'm trying to connect to local POSTGIS database using QGIS. I'm using the POSTGIS Tutorial form Buondless (rif. http://postgis.net/workshops/postgis-intro/index.html).

The context is the following:

  • Windows 7
  • "POSTGIS="2.1.1 r12113" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER"
  • QGIS 2.0.1

I can define the db, adding data from a shapefile and all seems work fine when I'm in pgAdmin.

When I Try to connect the postgis database from QGIS no connection works.

Here you are the configuration I'm using

Data base POSTGIS configuration QGIS connection parameters

The error is a generic "Check parameter and retry".

I've noted that if I don't set username and password the error is

FATAL: role "520" does not exist. 

520 is my network username in my Company. ??????


1 Answer 1


You need to tell QGIS that the database server is on running localhost. Try making Host = 'localhost'.

Also you are trying to connect to the postgres maintenance db. Try creating a spatial database using the postgis template, then try connecting to that.

CREATE DATABASE db_name TEMPLATE = template_postgis_20;
  • Hi Matt, I've tried to use Host= localhost but it doesn't work. I've tried also using the IP address but it doesn't work ...... :-)
    – Cesare
    Commented Feb 20, 2014 at 9:16
  • 1
    " ......you are trying to connect to the postgres maintenance db. ...." This is the key!!!! I'm NOT using the right name for my spatial db: the name is "nyc"
    – Cesare
    Commented Feb 20, 2014 at 9:34
  • Thank you very much Matt and sorry for my stupid question ..... :-)
    – Cesare
    Commented Feb 20, 2014 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.