Import shape file into postgis?

Henrik K picture Henrik K · Nov 16, 2016 · Viewed 12.8k times · Source

I can find multiple tutorials that show how to import shapefiles to postgis via pgAdmin-3. But pgAdmin-3 is no longer supported.

How to do this with pgAdmin-4?

Answer

chris picture chris · Nov 28, 2016

Disclaimer: I know this isn't a valid answer, but I don't have the reputation to comment.

I'd strongly recommend QGIS for this. The import dialog that comes with the Database Manager is rather great. First load the shapefile into QGIS and add a new connection via the "Add PostGIS Layers" button (elephant icon) on the left > "New". Then go to Database > DB Manager > DB Manager, select the newly created connection and open the import dialog (down arrow icon).

If you're into command line tools try ogr2ogr (http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet)