Hi Andreas,

To save the layer styles in a PG table is a cool feature ☺. I have no problems 
to save the table with a connection based on host/database.

A hint from me: QGIS stores the style-information with the data type “xml”. For 
me this made problems when exporting / importing this data. By default, the 
XMLPARSER from postgresql works with the "CONTENT" option. When importing a 
dump file from the “layer styles”-table you get an error message: “ERROR: 
invalid XML content”. To prevent this, you need to edit the dump file. Before 
the insert / copy command to insert the layer styles records you must add the 
statement “SET xmloption TO DOCUMENT;”.


Von: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] Im Auftrag von 
Andreas Neumann
Gesendet: Donnerstag, 28. Juli 2016 18:14
An: DelazJ
Cc: QGIS User List
Betreff: Re: [Qgis-user] Saving/Loading styles in Postgis

Strange. I can see the empty layer_styles table in my public schema. But saving 
fails. Maybe it fails because my PG connection is based on a service definition 
and not on host/database?
On July 28, 2016 6:08:01 PM CEST, DelazJ 
<del...@gmail.com<mailto:del...@gmail.com>> wrote:
Andreas,  Styles are indeed saved in the public schema, in a table named 
"layer_styles". I had never created such a table so I assume it's created by 
Just made a test and rename my current "layer_styles" table. Then I 
successfully save a new layer style in PG from QGIS 2.16: a new table 
"layer_styles" has automatically been created in the public schema.

2016-07-28 17:38 GMT+02:00 Neumann, Andreas 


I have never used the Saving/Loading of styles in Postgis (see 

Do I have to create a special styling table for it to enable this?

Because when I try to save it (QGIS 2.16) I get an error message along the 
lines that my user may not have permissions to save the style. However, I am 
trying to save the style with a user that has full administrator rights in 

In what schema and table are the styles stored? I assume in the public schema. 
Will QGIS automatically create a styling table or do I have to create one 

Thank you for any hints!


Qgis-user mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Qgis-user mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to