I have a table that has its geometry type as geometry and I need to convert it to Polygon for ogr2ogr to read it. Can't figure this out.
I have tried
ALTER TABLE oak_all_buffers ALTER COLUMN geom type geometry(MultiPolygon, 102689);
error
ERROR: Geometry type (MultiPolygon) does not match column type (Polygon)
********** Error **********
ERROR: Geometry type (MultiPolygon) does not match column type (Polygon)
SQL state: 22023
and
ALTER TABLE oak_all_buffers ALTER COLUMN geom type geometry(Polygon, 102689);
ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)
********** Error **********
ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)
SQL state: 22023

ogr2ogr -f gpkg -sql "select * from oak_all_buffers where OGR_GEOMETRY='POLYGON'" output.gpkg PG:input_string -nlt POLYGON. I wrote intentionally GeoPackage as outputformat because I do not know file geodatabase. – user30184 Apr 05 '17 at 14:07