3

I have saved a vector layer style to my PostgreSQL database source. I then amended the layer_styles table record for the relevant layer by editing the styleqml field (just changed the outline_width value for a simple renderer). The useasdefault field is set to true. When I save my project & restart QGIS the layer style does not change. If I then manually edit the layer style properties, select the 'Restore Default' button and select the 'Datasource database' option (see image) the changes are applied. I then save my project and exit. However, if I again amend the renderer XML in the database any changes made are not loaded next restart - i.e. QGIS retains it's last 'local' copy of the layer style and does not read the Datasource version automatically.

load

The docs say "When loading a layer from the database, if a style already exists for this layer, QGIS will load the layer and its style".

Question

Is this expected behaviour and if so can QGIS instead be configured to always load a layer style from the associated record in the layer_styles table at startup (the behaviour I expected)?

QGIS 2.14.2 (OS X KyngChaos build), PostgreSQL 9.5.1

  • I think that it is the expected behavior: the style is loaded from the DB when the layer is added, and is then stored locally in the .qgs file. I guess that it should somehow be possible to trigger an automatic update each time the project is reopened. – thibautg Oct 30 '18 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.