1

I have a spatial table in a SpatiaLite database that I'm editing in QGIS with no problem (the spatial table was created through SpatiaLite GUI).

I then added a text field to the table through SQL statement and I can edit this column in SQLite Studio or SpatiaLite GUI! However, this column doesn't show in QGIS, even if I add the layer to a clean project!

Any thoughts on how to update the field list in order to be correctly recognized in QGIS?

2
  • could you post the table structure details and the SQL you used to add the column?
    – geozelot
    Mar 27, 2019 at 19:04
  • It was the basic SQL structure to add a column: ALTER TABLE table_name ADD COLUMN column_name [field_type];
    – Carlos MSF
    Mar 28, 2019 at 15:03

1 Answer 1

2

I've managed to solve this executing the Update Layer Statistics over the table through SpatiaLite GUI, which corresponds to the SQL statement:

SELECT UpdateLayerStatistics();

Apparently, this function updates the field info in the geometry_columns_field_infos metadata table.

After this, the field list shown in QGIS was correct.

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.