I'm currently trying to export a .gdb containing polygons to PostGIS which other users will need to display using any software like QGis or ArcGIS. I'm using ogr fom osgeo to export the GDB to PostGIS using the following command:

ogr2ogr -f "PostgreSQL" "PG:[db-connection]" "[.gdb-path]" -nlt PROMOTE_TO_MULTI -overwrite -skipfailure -progress 

This manages to upload everything to PostGIS, however the "wkb_geometry" column uses "bytea" as the dafault datatype and when I try to display the geometries using QGIS I'll get the feedback that my table doesn't contain any geometry-type.

So I guess my question would be: Why does this happen and how can I use osgeo (or other tools) to export a gdb to PostGIS as a "proper" geometry type?

I'm glad for any help/pointers

  • 1
    Have you enabled the postgis extension on your database? – BERA Nov 16 '20 at 14:32
  • 1
    I thought I did, but I didn't =( Thank you very much - problem solved – BastiG Nov 16 '20 at 14:39

Maybe you forgot to create/enable the postgis extension on your database?


GEOM_TYPE: The GEOM_TYPE layer creation option can be set to one of “geometry”, “geography” (PostGIS >= 1.5), “BYTEA” or “OID” to force the type of geometry used for a table. For a PostGIS database, “geometry” is the default value

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