[GIS] How to fix QGIS PostGIS Manager error ‘shp2pgsql’ is not recognized

postgispostgresqlqgisqgis-plugins

I have QGIS 1.8.0 installed via OSGeo Installer and work on win 7.
All I need is to upload the shapefile to the database via this plugin. Unfortunately I am receiving an error:

Something's wrong:
["'shp2pgsql' is not recognized as an internal or external command,\n", 'operable program or batch file.\n']

How to install and configure shp2pgsql to make this plugin work fine?

Best Answer

Shp2pgsql.exe should be in folder C:\Program Files (x86)\Postgresql\9.0\bin.

It might help to include the folder to the systems PATH variable (although it is not here with me).

I don't know how Qgis reacts if you updated your Postgres or Postgis version after installing Qgis.

Does the DB Manager plugin see your Postgis databases?

The plugin help gives this hint:

Note: not having PostGIS installed on your local machine or being installed in some non-standard location will render this feature unusable because of the missing shp2pgsql tool.

According to this message: http://osgeo-org.1560.n6.nabble.com/Re-Qgis-user-PostGIS-Manager-compatibility-issue-with-PostGIS-2-0-td4957715.html#a4958320 the Postgis manager plugin should be replaced by the DB manager.

Unfortunately, the option to import data is still missing. But you can drag and drop shapefiles from Qgis Browser to DB Manager plugin which will do the same.

Related Question