Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to write a python macro that upon opening my QGIS project file will reload the default style for each layer from the postgres 'layer_style' table. I have had a look at the documentation and can only work out how this is done from a sqlite db or .qml file.

Any pointers would be appreciated. I am running QGIS 1.9 Master. Thank you.

share|improve this question
Matt, from QGIS 2.0, It will be possible to save layer styles in Postgresql\postgis database. I know it's not the same, but maybe it solves your need. Take a look here – Alexandre Neto Jun 27 '13 at 8:53
I have done that, I would like to know if it is possible to reload the default styles from the postgresql layer_style table using Python. – Matt Jun 27 '13 at 9:21
Sorry, I misunderstood it. – Alexandre Neto Jun 27 '13 at 9:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.