On 11/12/2015 07:13 PM, Alex M wrote:
Yes we should implement a cheat in QGIS (core) to handle this issue.
Other SQLite GUIs do this. Spatialite GUI and SQLite Manager (Firefox
plugin).

The basic process:
1. Make a new table the way you actually want it.
2. SQL INSERT records from Old to New (Mapping old columns to new if
name changed).
3. Remove old table
4. Rename new table to old name
5. Vacuum to recover extra pages allocated in the shuffle.

Nothing else should be needed, since you use the same name, spatial
indexes and geometry_column records should stay the same unless the
Geometry column is renamed.

This method will apply to both GeoPackage (If editing is allowed),
Spatialite tables, and any non-spatial sqlite tables.

-Alex

One caveat: if foreign keys, or views are defined (the reasons for using a spatialDB in the first place) pointing to a column in the table to be reshuffled, this process fails. Since sqlite does not have any "DROP CONSTRAINT" then you have to start renaming the other dependent tables also...




On 11/12/2015 04:30 AM, Matthias Kuhn wrote:
The main issues with spatialite are IMO: It's based on sqlite so
deleting columns and renaming columns is not supported by design. We
could offer some hacks to bypass this (annoying restriction) from the UI
- there is a risk of side effects though. Another property of it is,
that it's already 4-5MB big, even when empty. I consider this a major
limiting factor as well. Other issues which we were not yet able to
solve are its management of the information scheme which keep duplicate
entries of tables and columns which need to be properly updated which we
apparently do not manage (yet).

Geopackage is also based on sqlite, so the column delete/rename
restrictions apply as well (with the same workaround possibilities). I
haven't checked the file size, but if that's smaller, that would be
quite nice (does somebody know?).

All the best
Matthias
_______________________________________________
Qgis-user mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


This mail was received via Mail-SeCure System.



--
Micha Silver
Arava Drainage Authority
+972-523-665918
_______________________________________________
Qgis-user mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to