[QGIS-Developer] QGIS & field computer and unauthorized DB structure change
Elstermann, Mike
Mike.Elstermann at itc-halle.de
Mon Mar 4 07:14:54 PST 2024
Hello everyone,
I have noticed the following: if I have read and write access (DML) to a PostgreSQL table, but no access to structure changes (DDL), then I can, for example, add new columns with the field calculator and fill them with results. Everything seems to run normally, I do not get a warning that I am not allowed to change the structure, the results generated in the field calculator are OK. After saving, all new columns including the data are gone. Can a corresponding preliminary check with warning be added here please?
If a new column is explicitly added, a message appears whose content does not match the situation.
"Could not add field 'Test' of type 'text'. Is the field name unique?“
A warning regarding missing authorizations for DB structure changes would be better.
As far as I know, there is no QGIS ticket or change request(https://github.com/qgis/QGIS/issues) to improve the user guidance for these two cases.
There are currently two relevant sections in the error messages(https://github.com/qgis/QGIS/blob/master/i18n/qgis_de.ts).
<message>
<location filename="../src/app/qgsattributetabledialog.cpp" line="969"/>
<source>Failed to add field '%1' of type '%2'. Is the field name unique?</source>
<translation>Could not add field '%1' of type '%2'. Is the field name unique?</translation>
</message>
<message>
<location filename="../src/gui/vector/qgssourcefieldsproperties.cpp" line="286"/>
<source>Failed to add field '%1' of type '%2'. Is the field name unique?</source>
<translation>Could not add field '%1' of type '%2'. Is the field name unique?</translation>
</message>
Many thanks in advance.
Mike Elstermann
More information about the QGIS-Developer
mailing list