I've made a plugin asking for login credentials to a DB. Once logged in, the plugin is loading some layers from the DB. In the DB there are both admin and "normal" users.

I've saved two styles to the DB from the UI as default style for their layer respectively (seems you have to have DB admin rights to be able to save them).

Once I've saved the styles to the db I'm not able to see where they are stored i.e., I can't see any new tables. (I expected the styles to be saved in a table)

Running QGIS and the plugin again (as admin user) the layer styles are loaded automatically.

But, running QGIS and the plugin again (as normal user rnd) they are not loaded automatically. I then try to load the styles from the DB (from the GUI), but no styles are loaded.

Two questions.

  1. How are the layer styles stored in the DB?
  2. Is there a way to load the layer styles without DB admin rights?
  • Does your normal users were granted access to the your tables? how about to your style tables? Apr 2, 2014 at 8:58
  • My normal users have access to the layers tables. They get loaded as they should. Regarding style tables, that is the problem. I had expected there to be style tables but can't see them in the DB using pgAdmin. Could be that styles are stored in another way, but how? If I could locate any style tables I could give normal users access tights to them.
    – user28233
    Apr 2, 2014 at 9:07

1 Answer 1


The styles are normally saved in public.layer_styles.

Being in the public schema it should be accessible to every user. If not, make sure it becomes using:

GRANT SELECT ON TABLE public.layer_styles TO users;
-- "users" is a group with all your #normal users
  • I was unaware that styles were saved in public (working with a db with several schema).
    – user28233
    Apr 2, 2014 at 14:12

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.