Bug report #20068

Geopackage: problems with renaming or drop tables

Added by Burghardt Scholle almost 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:Normal
Assignee:Even Rouault
Category:Data Provider
Affected QGIS version:3.2.3 Regression?:No
Operating System:Windows 7 64bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:27890

Description

Hi,
after deleting a table in a geopackage, I can no longer create a table with the same name in the same gpkg file. After renaming a geometry table in a gpkg file, the geometry elements in QGIS (2.x, 3.x) are no longer displayed. It doesn't matter if I use the QGIS DB Manager or the spalite_gui to perform the above actions. Even a vacuum doesn't help. I suspect that not all parts of the table (views, indexes, etc.) are renamed or deleted.
Regards
Burghardt

GeoPackage_1.png (11.8 KB) Burghardt Scholle, 2018-10-11 11:08 AM


Related issues

Related to QGIS Application - Bug report #20077: geopackage - table operations via network shares take a v... Open 2018-10-11

History

#1 Updated by Giovanni Manghi almost 2 years ago

as far as I can remember this is a long standing issue, affecting also Spatialite tables.

#2 Updated by Burghardt Scholle almost 2 years ago

I feared this answer :-).

#3 Updated by Alessandro Pasotti almost 2 years ago

I've just tested delete a GPKG table from the browser and re-create it with the same name and it works just fine on current master. Rename from the browser was never implemented so I didn't test it.

I would suggest to narrow down the issue and open a separate one for each specific case: delete->recreate vs rename->create , from DB-Manager, from the browser and from ?????

#4 Updated by Giovanni Manghi almost 2 years ago

  • Status changed from Open to Feedback

#5 Updated by Even Rouault almost 2 years ago

I cannot replicate the issue on Linux with QGIS master and GDAL master.
What I did:
- open a GeoPackage with a single vector layer in DBManager
- right click on the table in the tree to delete it
- use Table/Create table to re-create a table with the same name
- right click on the table in the tree to rename it

Could you attach the initial GeoPackage, explain precisely how you delete the table, and attach the updated GeoPackage resulting from this action ? And also the error message you get when you say " I can no longer create a table with the same name in the same gpkg file".

I also tried to delete from the Browser in the main window and use Layer/Add new Layer to create, and that works fine.

#6 Updated by Burghardt Scholle almost 2 years ago

Hi,
first of all Thank you very much for your answers.
This morning I did extensive tests with geopackage files. I have run these tests with different systems (Windows 7 Pro 64bit, Windows 10 Pro, Xubuntu 18.04). I have used both my original geopackage and a newly created geopackage. I have done my tests with QGIS Master (QGIS code revision 7c0a2a1cd7).
The good news is that the tests for renaming and deleting tables work fine in both the browser and the DB Manager with QGIS Master - if the geopackage is stored locally or a completely new geopackage is created. The latter can also be located on a network drive. In this respect I can confirm the results of Alessandro.
BUT: As soon as I access an existing (older) geopackage via network, I get problems. Saving a new table takes "forever". What only needs a few moments locally, runs over 30 minutes in the network with the same table! Can anyone confirm this behaviour?
Unfortunately, I cannot provide the protected data I use. I will create a new geopackage with OpenStreetMap data later this day and continue my tests with it. I can then offer this geopackage as well.

#7 Updated by Giovanni Manghi almost 2 years ago

Burghardt Scholle wrote:

geopackage via network,

a network shared folder? on what protocol (i.e. samba, nfs, etc,)?

#8 Updated by Burghardt Scholle almost 2 years ago

At the moment only smb, but I will try nfs during the day.

#9 Updated by Burghardt Scholle almost 2 years ago

I have created a new geopackage with OpenStreetMap data under QGIS Master. Unfortunately, there is also the problem with shared network folders here (samba share). Creating a new table with a name that was previously used for a dropped table takes a long, long time. I create the new table via the context menu "Export -> Save as" of the layer. Once triggered, the process can only be aborted under Windows using the TaskManager. When trying to close QGIS, the message documented in the attached screeshot appears. After clicking on "Yes" QGIS will not be closed. If I copy the same geopackage into a local directory, the described process can be successfully completed within a few moments.

#10 Updated by Giovanni Manghi almost 2 years ago

Burghardt Scholle wrote:

I have created a new geopackage with OpenStreetMap data under QGIS Master. Unfortunately, there is also the problem with shared network folders here (samba share). Creating a new table with a name that was previously used for a dropped table takes a long, long time. I create the new table via the context menu "Export -> Save as" of the layer. Once triggered, the process can only be aborted under Windows using the TaskManager. When trying to close QGIS, the message documented in the attached screeshot appears. After clicking on "Yes" QGIS will not be closed. If I copy the same geopackage into a local directory, the described process can be successfully completed within a few moments.

so the issue now is completely different from the one originally described, correct? if yes this should be closed and a new one opened about this issues with table operations over network shares.

#11 Updated by Burghardt Scholle almost 2 years ago

You're right. I've created the new issue #20077 (edited). Can you please close this issue? Thanks.

#12 Updated by Giovanni Manghi almost 2 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

#13 Updated by Jürgen Fischer almost 2 years ago

  • Related to Bug report #20077: geopackage - table operations via network shares take a very long time added

Also available in: Atom PDF