[QGIS-Developer] QGIS & field computer and unauthorized DB structure change

Régis Haubourg regis.haubourg at gmail.com
Tue Mar 12 00:25:49 PDT 2024


Hi Mike,

well, this is questionnable. One could just add columns during the 
session and save the table in another provider.

This should probably be only a soft warning and not something blocking 
those features.

Please feel free to open an issue with the tag "feature request". 
Implementation though will not appear by magic (sometimes it does 
though, we have some magic elves), feature are usually funded by users 
having this on their critical path.

Best regards

Régis


On 04/03/2024 16:14, Elstermann, Mike via QGIS-Developer wrote:
> 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
>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240312/29022027/attachment.htm>


More information about the QGIS-Developer mailing list