[gdal-dev] I can't get ogr2ogr to overwrite an existing table

Saulteau Don sault.don at gmail.com
Fri Apr 7 15:46:38 PDT 2017


just a guess, thinking off the top of my head but does it need the -update
flag too?

On Fri, Apr 7, 2017 at 1:59 PM, Stephen Woodbridge <woodbri at swoodbridge.com>
wrote:

> Hi all,
>
> I'm having trouble figuring out how to overwrite an existing table with
> ogr2ogr. I have tried various combos of arguments without success.
>
> What am I doing wrong?
>
> ogr2ogr -t_srs EPSG:4326 -nln roads -nlt PROMOTE_TO_MULTI -f PostgreSQL
> -overwrite -lco OVERWRITE=YES -lco PRECISION=NO -lco GEOMETRY_NAME=geom
> -lco FID=gid "PG:dbname=buildings host=localhost port=5435 user=postgres
> active_schema=census" /data/census/tmp-10195/tl_2016_06013_roads.shp
>
> ERROR 1: CREATE TABLE "census"."roads" ( "gid" SERIAL, PRIMARY KEY ("gid")
> )
> ERROR:  relation "roads" already exists
>
> ERROR 1: Terminating translation prematurely after failed
> translation of layer tl_2016_06013_roads (use -skipfailures to skip errors)
>
>
> ogr2ogr -t_srs EPSG:4326 -nln census.roads -nlt PROMOTE_TO_MULTI -f
> PostgreSQL -overwrite -lco OVERWRITE=YES -lco PRECISION=NO -lco
> GEOMETRY_NAME=geom -lco FID=gid "PG:dbname=buildings host=localhost
> port=5435 user=postgres" /data/census/tmp-10747/tl_2016_06013_roads.shp
>
> ERROR 1: CREATE TABLE "census"."roads" ( "gid" SERIAL, PRIMARY KEY ("gid")
> )
> ERROR:  relation "roads" already exists
>
> ERROR 1: Terminating translation prematurely after failed
> translation of layer tl_2016_06013_roads (use -skipfailures to skip errors)
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170407/84acc537/attachment.html>


More information about the gdal-dev mailing list