2

So in QGIS, GeoPackage will be automatically saved when it is read even if you didn't edit. How to avoid this from happening?

3
  • 1
    Perhaps by making the .gpkg file as read-only.
    – user30184
    Aug 8, 2019 at 20:13
  • 1
    Yep, make it read-only - osgeo-org.1560.x6.nabble.com/…
    – user2856
    Aug 8, 2019 at 21:47
  • But this is quite troublesome if you suddenly want to edit those layer of geopackage. I don't quite understand why QGIS need to save it when it is only reading.
    – Ken T
    Aug 9, 2019 at 3:38

1 Answer 1

1

It may have something to do with database file locking and concurrency https://www.sqlite.org/lockingv3.html and the wal mode that QGIS is using https://sqlite.org/wal.html. It might be possible to avoid writing by opening the database as immutable https://sqlite.org/uri.html#uriimmutable but that would require a new option for QGIS. Also you could not suddenly decide to start editing but you should open the database again in readwrite mode.

If you need to know when the GeoPackage was last edited you can have a look at last_change attribute in the gpkg_contents table. Unfortunately I do not believe that QGIS can show that information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.