Bug report #21814

source fields list does not update when layer is overwritten

Added by Brett Carlock almost 5 years ago. Updated almost 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Data Provider
Affected QGIS version:3.6.1 Regression?:No
Operating System:Win10 x64 Pro (1809 Build 17763.404) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29629

Description

STR:
Have a layer stored in a geopackage with N number of fields (5, for example).

Overwrite this same layer in the geopackage to a new version with 7 fields.

Actual behavior:
Right click layer, Source Fields still lists only the original 5 fields.

Entering/leaving edit mode does not expose those new fields.

Organize columns on the Attribute Table does not expose those new fields.

Expected behavior:
New fields are visible as soon as layer is overwritten.

History

#1 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Open to Feedback

This is not limited to GPKGs: for instance load a PostGIS table, then add a column from a different backend other than QGIS (or also in QGIS using db manager and a query), if you open the TA the new column will not show.

You may want to re-word this ticket subject and description then... but I'm almost sure that this is/was already filed.

#2 Updated by Brett Carlock almost 5 years ago

Giovanni Manghi wrote:

This is not limited to GPKGs: for instance load a PostGIS table, then add a column from a different backend other than QGIS (or also in QGIS using db manager and a query), if you open the TA the new column will not show.

You may want to re-word this ticket subject and description then... but I'm almost sure that this is/was already filed.

I can't speak to any other database engine than geopackage, as that is all I use at current.

However, it is interesting to note that you mention adding the column from another backend from QGIS.
In my above example, I'm only using QGIS from within the same session as where the data is loaded. I would think that in this manner these changes would be tracked/accounted for and the data would reflect this without having to Close/Re-Open the project.

Does your PostGIS behave as expected if you add a column via QGIS in the same session as I've outlined above?

#3 Updated by Giovanni Manghi almost 5 years ago

  • Status changed from Feedback to Open
  • Subject changed from Source Fields list does not update when layer is overwritten in geopackage to source fields list does not update when layer is overwritten

I can't speak to any other database engine than geopackage, as that is all I use at current.

However, it is interesting to note that you mention adding the column from another backend from QGIS.
In my above example, I'm only using QGIS from within the same session as where the data is loaded. I would think that in this manner these changes would be tracked/accounted for and the data would reflect this without having to Close/Re-Open the project.

Does your PostGIS behave as expected if you add a column via QGIS in the same session as I've outlined above?

Maybe mine was not the best example. Bottom line is that I see what you mean, but anyway as far as I can remember a full replacement of a a datasource (already loaded in a qgis project) from within qgis has never triggered a reload of the project (that is what you need if you want see the changes).

Also available in: Atom PDF