I am receiving the following error when trying to import a dbf file into PostgreSQL (v 12, pgAdmin 4) using the Boundless/OpenGeo Suite for Mac pgShapeLoader
GUI (which was recommended for Mac users in a Stack Exchange answer here, since there is no shapefile importer GUI included in the most recent Mac installation: Shapefile loader in pgAdmin 4):
Failed SQL begins: "CREATE INDEX ON "public"."soildef" USING GIST ("geom");
COMMIT;
"
Failed in pgui_exec(): ERROR: column "geom" does not exist
Shapefile import failed.
The pgShapeLoader
GUI worked fine for me when importing shapefiles, but it is producing the above error for the dbfs. And I know it should work because it is working for everyone using Windows for the PostGIS tutorial I'm following on Udemy (meaning, there is nothing wrong with the dbf itself).
The Windows installation of PostgreSQL/PostGIS has a shapefile loader gui shp2pgsql-gui.exe
, but unfortunately this does not appear to be included in the Mac install. There is only a Unix executable shp2pgsql
in the bin folder.
Are my only options for importing the dbfs to use the command line and/or to do this through QGIS, per another answer on the linked SE question/answer above? I am not finding any other solutions. Or maybe the question I should really be asking myself is simply: "How do you import a dbf into PostgreSQL on a Mac?" (Which seems a bit obvious now that I'm typing it, but I'd like to post this question anyway for anyone else who might run into this problem).
.dbf
data is part of the shapefile standard, so any shapefile loader should automatically include the attributes with geometry.