[QGIS-Developer] GeoPackages with constraint problems

Patrick Dunford enzedrailmaps at gmail.com
Sun Aug 12 13:18:45 PDT 2018

Hi Matthias

I have seen this type of error message comes up when trying to open a 
geopackage from a 3.x project in 2.18

No data corruption in the original layer as far as I can tell.

On 04/08/18 01:59, Matthias Kuhn wrote:
> Hi everyone,
> I recently gave a course where geopackages were used as datasets. Those
> geopackages had foreign key constraints (among others) activated. While
> editing those files, at least on one machine, someone managed to get it
> into a "corrupted" state (layer disappeared). Trying to load this layer
> later on will result in a bad layer. The only thing we have is a tiny
> message in the message log informing about "pragma foreign_key_check on
> 'file.gpkg' failed. You can disable this check by setting the
> OGR_GPKG_FOREIGN_KEY_CHECK configuration option to NO".
> I think it's quite strange that QGIS/OGR manages to bring a GeoPackage
> into a corrupted state and then denies to open it.
> * It would - I guess - be preferable to prevent a GeoPackage from going
> into such a state
> * Since it appears to be quite easy to bring a dataset into such a state
> (although I'm afraid I can't provide detailed steps) QGIS should by
> default probably rather open (and warn) or warn and give a possibility
> to still open.
> Did others experience this as well and have more ideas what to do?
> Thanks and best wishes
> Matthias
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

More information about the QGIS-Developer mailing list