[gdal-dev] GPKG to PostgreSQL, version 2.2.3 vs version 3.0.2

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Thu Apr 9 06:14:01 PDT 2020


Hi,

I would have a try with -unsetfid. That should be the default when in append
mode but the test is easy.

-Jukka Rahkonen-


Ari Jolma-2 wrote
> I have this command
> 
> ogr2ogr -update -append -f PostgreSQL PG:... merged.gpkg
> 
> which works ok in version 3.0.2 (self-compiled) but not in 2.2.3 (from 
> ubuntu apt). The error is
> 
> ERROR: duplicate key value violates unique constraint "stand_pkey"
> DETAIL: Key (id)=(1) already exists.
> CONTEXT: COPY stand, line 1
> STATEMENT: COPY "stand" ("wkb_geometry", "standid", "parcelid", 
> "realestateid", "standnumber", "standnumberextension", "maingroup", 
> "subgroup", "fertilityclass", "soiltype", "drainagestate", 
> "ditchingyear", "thinningyear", "developmentclass", "standquality", 
> "maintreespecies", "accessibility", "standinfo", "datasource", 
> "growthplacedatasource", "area", "areadecrease", "creationtime", 
> "updatetime") FROM STDIN;
> 
> The issue is that "stand_pkey" is "CONSTRAINT stand_pkey PRIMARY KEY 
> (id)" made by the
> 
> ogr2ogr -overwrite -f PostgreSQL PG:... merged.gpkg
> 
> earlier. So it shouldn't be in the COPY data at all (the log does not 
> show whether it is there) or there is something wrong with the sequence.
> 
> Is there a way to make it work in the older version?
> 
> Ari
> 
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list