Selon Pete <pet...@pembrokeshirecoast.org.uk>: > Hi, Sorry to revive this post but I'm a non GIS type and have a similar > issue. > > I'm trying to upload a mapinfo layer using WinSCP and Ogr2Ogr to work it's > magic to put it into the GeoStore, this via GeoServer ensures our Openlayers > map is up-to-date. > > The trouble is that I get the exact same error IF the existing table being > overwritten has views based on it, otherwise the overwrite works fine. > > The views go to make up the layers on the map that can be turned on/off. I > really don't want to end up with a table for each of these ! > > Is this possible ? is there a better way of doing it ? > > *The command weâre using * > call ogr2ogr -f "PostgreSQL" PG:"host=localhost user=pembs dbname=pembs > password=12345" ./WindTurbines.TAB -nln public.windturbines -lco > OVERWRITE=YES -T_SRS EPSG:27700 > > *The Error we get* > failed with return code 1 and error message > ERROR 1: CREATE TABLE "public"."windturbines" ( OGC_FID SERIAL, CONSTRAINT > "windturbines_pk" PRIMARY KEY (OGC_FID) ) > ERROR: relation "windturbines" already exists > ERROR 1: Terminating translation prematurely after failed > translation of layer WindTurbines (use -skipfailures to skip errors). > > > Appologies again that i'm not a GIS bod so hope my lack of understanding > doesn't confuse you!
I guess that the -lco OVERWRITE=YES that cause a "DROP TABLE windturbines" must fail because the table is referenced by the views. One option, provided that the structure of the existing windturbines table is compatible with the windturbines.tab file you want to inject into it, would be to : 1) ogrinfo PG:"host=localhost..." -sql "DELETE FROM windturbines" 2) ogr2ogr -update -append PG:"host=localhost..." ./WindTurbines.TAB -nln public.windturbines > > Pete > > > > -- > View this message in context: > http://osgeo-org.1560.n6.nabble.com/Mapinfo-postgis-db-using-ogr2ogr-failing-to-overwrite-tp3743940p5040341.html > Sent from the GDAL - Dev mailing list archive at Nabble.com. > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev