Bug report #16174
DB-Manager: updating GeoPackage tables doesn't work
|Affected QGIS version:||2.18.3||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24084|
I'm trying to insert data into the tables gpkg_contents and gpkg_geometry_columns but it doesn't work...
Here's how to reproduce the problem:
1. Open DB-Manager and add a connection to a GeoPackage
2. Create a new table with the SQL command "CREATE TABLE foo AS SELECT * FROM bar"
3. Re-connect the GeoPackage to see the new table (using refresh doesn't work)
4. Try to modify the gpkg_geometry_columns table using "INSERT INTO gpkg_geometry_columns VALUES ('foo','geometry','POLYGON',2056,0,0)"
5. The table seems to be modified when we look at it using "SELECT * from gpkg_geometry_columns"
6. Close QGIS, open it again, open DB-Manager, re-connect the GeoPackage
7. Try again "SELECT * from gpkg_geometry_columns", the added row is not there anymore
QGIS creates a file called "geopackage_name.gpkg-journal" where the changes are probably saved... However this file is not removed when removing the connection in DB-Manager or when closing QGIS.
Do I need to execute "VACUUM gpkg_geometry_columns" after the modifications?