[gdal-dev] Primary keys are ignored in ogr2ogr when converting from Sqlite databases

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Fri Dec 9 00:49:01 PST 2016


César Martínez wrote
> Is this a bug or is an intended behaviour? Is there any way to workaround
> it?
> I am using GDAL version 1.11.3. It also happens when exporting to a
> different format such as PostGIS.

A workaround is to pick the primary key as a normal attribute and let GDAL
to create its own primary key. You can add a unique constraint to ID
afterwards https://www.techonthenet.com/sqlite/unique.php and then it is
almost like a PK for you



Easier way for preventing duplicate values would be to create an unique
index on ID.

-Jukka Rahkonen-



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Primary-keys-are-ignored-in-ogr2ogr-when-converting-from-Sqlite-databases-tp5299286p5299325.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list