1

Is it possible to save metadata of a QGIS 3 layer in a database (PostGIS), similar to the function in QGIS 2.18 "save layer style to database".

I don't want to save it in the project or as a file.

2.18

3.4

1 Answer 1

0

The documentation states that ‘For PostgreSQL data sources if the configuration option Allow saving/loading QGIS layer metadata in the database is checked the metadata are stored inside a dedicated table in the database.’

It was difficult to get it to work. For my first attempts, I enabled saving metadata in the DB Connection Settings (which I had previously left unchecked), then wrote a short description in the abstract field (Zusammenfassung in the OP's localised screenshot) and then tried to save it as default. (Als Vorgabe in the screenshot). But when I tried to restore the default (Vorgabe wiederherstellen), I just got a ‘Metadata not found in database’ message.

However, at some point it started to work. I noticed that I have a table named qgis_layer_metadata in the same DB schema where my data layers are. If you have this table, then it works, or has at least worked at some point in time. (You can of course check the contents of this table to see if any of your metadata edits have been saved.) Note that if you edit the metadata fields, the changes will not be saved into the DB unless you click MetadataSave as Default.

There seems to have been a lot of related issues in GitHub, and some of them requested for extensive design changes, so even though they're all in a closed or merged status by now, I'm still wondering if further changes are on the way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.