I am using shp2pgsql in a bash script to import shapefiles into postgres. I can successfully do this for shapefiles with hundreds of records however shapefiles with tens of thousands of records (in this case ~40,000) hangs so I have to use the postGIS shapefile importer in pgAdmin (which works ~30-45 seconds to complete).

I realize it's a substantial jump in magnitude regarding the number of records. Is it possible if I wait long enough it will succeed?

what are the runtime/data limits for shp2pgsql?

  • 2
    Read gis.stackexchange.com/questions/109564/… and try shp2pgsql with -D switch. I also suppose that the shapefile importer in pgAdmin actually is shp2pgsql.
    – user30184
    Jun 21, 2017 at 20:15
  • @user30184 that did the trick! I think you are correct that shp2pgsql is just the command line for the importer.
    – Don P
    Jun 21, 2017 at 22:01


Browse other questions tagged or ask your own question.