I have a problem loading my shapefile named watershed and link it to my table in postgresql named watershed as mentioned here:

shp2pgsql -I -s 32632 C:\Users\ASUS\Desktop\master_PEER\DATABASE\Shapefile\watershed.shp watershed | psql -U postgres -d Chiba_watershed.

shp2pgsql : Le terme «shp2pgsql» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez. Au caractère Ligne:1 : 1 + shp2pgsql -I -s 32632 C:\Users\ASUS\Desktop\master_PEER\DATABASE\Shap ... + ~~~~~~~~~ + CategoryInfo : ObjectNotFound: (shp2pgsql:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException


[2]: https://i.stack.imgur.com/jETfb.jpgemphasized text

How to resolve this problem?

  • Go to the directory where you have the shp2pgsql.exe before trying to run it or add the path into the PATH environment variable. Error means that Windows does not know where the shp2pgsql program is. – user30184 May 15 '19 at 14:36

It looks as though shp2pgsql is not recognised. You may need to either

A) Run with the full path to the folder containing shp2pgsql.exe in front of shp2pgsql in the command


B) You need to make sure that the shp2pgsql.exe is in a folder that's on the PATH environment variable

| improve this answer | |
  • I tried the two proposition but it didn't work – Saifeddine Farjallah May 17 '19 at 11:12
  • Did you get a different error? The above error is because it does not understand where to get the shp2pgsql command from. Perhaps you could change directory to the folder that holds shp2pgsql.exe and run from there – ProudGIS May 17 '19 at 13:54
  • shp2pgsql works now. I just restart my computer and the environment set in working. Thank you. But i have now an other problem. I'm creationg a table in postresql but i'm unable to password is not working do you an idea about this – Saifeddine Farjallah May 17 '19 at 14:35
  • I can only assume that the User you are running the connection with does not have create permission on the database you are connecting to. I would look at the GRANT documentation here - postgresql.org/docs/10/sql-grant.html – ProudGIS May 17 '19 at 14:43
  • Either that or you are not using the correct password... – ProudGIS May 17 '19 at 14:44

Use Postgis 2.0 Shapefile and DBF loader exporter.

enter image description here

| improve this answer | |
  • I tried this also but i had this message: Importing with configuration: watershed, public, geom, C:\Users\ASUS\Desktop\master_PEER\DATABASE\watershed.shp, mode=a, dump=0, simple=0, geography=0, index=0, shape=1, srid=32632 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed in pgui_exec(): ERROR: Geometry type (MultiPolygon) does not match column type (Polygon) Import failed on record number 0 Shapefile import completed. – Saifeddine Farjallah May 17 '19 at 11:20
  • what version of postgis are you using? – Ayaz49 May 17 '19 at 11:34
  • the version is postgis 2.0 – Saifeddine Farjallah May 17 '19 at 15:13

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