[gdal-dev] OGRDataSource::CopyLayer, PostGIS

Rui L. Pires rlpires at gmail.com
Wed May 9 11:47:28 EDT 2012


Hello everyone,

when using the method OGRDataSource::CopyLayer with a PostGIS data
source my data gets copied perfectly, however I'm seeing that the
sequence for the feature id is not properly set up to the last
existing id (ie. the current stays at 1).

Obviously attempting to create a new feature fails. Once I set the
sequence current value to the highest id, feature creation is OK.

I wonder whether CopyLayer should provide this setup or if the user is
expected to explicitly run a query (like I did) to appropriately
configure the id sequence.

I'm using gdal 1.8 but having looked at the code I believe the same
behaviour can be observed in 1.9.

Thanks in advance for your feedback.

Regards,
-- RLPires


More information about the gdal-dev mailing list