qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.54k stars 2.99k forks source link

Column aliases are not written to geopackage when editing them in Attributes form window #55821

Open Hajna opened 9 months ago

Hajna commented 9 months ago

What is the bug or the crash?

related issue: https://github.com/qgis/QGIS/issues/47344

context: column aliases are not written to geopackage when editing them in Attributes form window.

problem: there is no way (at least through UI) to edit aliases of existing columns

if this is expected behavior, please excuse me and close this issue.

when creating a new field, we can set up its alias, which is then stored to geopackage system table (gpkg_data_columns) however for existing fields, the option to set up the alias is not enabled

reading the related issue, it is evident that alias setting has been moved to Attributes form window, however, setting the alias in the Attributes form, does not save its value to gpkg_data_columns table

Steps to reproduce the issue

Create a new geopackage with one dummy field

image

Opening the layer properties and navigating to Field section, you are unable to edit the field alias

image

When adding a new field, we are able to set its alias

image

which is in return stored to the gpkg_data_columns system table

image

if we try to set the alias in the Attributes forms, the alias is not stored to the system tables, and it does not persist if we try to remove and reload the layer:

image

Versions

3.34.2-Prizren

Supported QGIS version

New profile

Additional context

No response

phidrho commented 1 month ago

Hi,

alias field in Layer Properties panel is saved within QGIS project, and is not pushed back to layer data source. Therefore this is an expected behavior, because you are not editing layer this way, but only representation within QGIS application. Since QGIS supports many data formats, and only some can have Aliases written inside the data source. So this is actually not a bug report but rather an Feature request for special case (when data is stored in GPKG).

You can access Alias editing on Browser panel, then it will be stored inside GPKG as you expect: image