sorry it's google translate An error occurred while importing data into PostGIS using shp2pgsql. Among multiple shp files, an error occurs only in data with "" special characters.

enter image description here

The command I used is this

shp2pgsql -s 3857 -W UTF-8 -I -c -g the_geom C:\data\vector01.shp test_tb | psql -h localhost -p 5432 -U user -d dbname

But when I run it with shp2pgsql-gui.exe, there is no problem

  • Assuming you've been able to make the conversion using the GUI version, this might make a good bug report (after you create a minimal reproducible example)-- or is there a reason you can't use the GUI version? Aug 22, 2022 at 12:12

1 Answer 1


whenever you run command line tools, enclose your filename in double quotes, like this:

shp2pgsql -s 3857 -W UTF-8 -I -c -g the_geom "C:\data\vector01.shp" test_tb | psql -h localhost -p 5432 -U user -d dbname

Your Answer

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

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