Bug report #16174

DB-Manager: updating GeoPackage tables doesn't work

Added by Jérôme Guélat almost 8 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:Even Rouault
Category:DB Manager
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

Description

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?

Associated revisions

Revision 4eed39b6
Added by Even Rouault about 7 years ago

[DB Manager / GPKG] Fix COMMIT with GDAL 2 (fix #16174)

Revision e744633f
Added by Even Rouault about 7 years ago

[DB Manager / GPKG] Fix COMMIT with GDAL 2 (fix #16174)

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Even Rouault about 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF