<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmail-hoenzb
        {mso-style-name:gmail-hoenzb;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Andreas,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">To save the layer styles in a PG table is a cool feature
</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">. I have no problems to save the table with a connection based on host/database.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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;”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Burghardt<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Qgis-user [mailto:qgis-user-bounces@lists.osgeo.org]
<b>Im Auftrag von </b>Andreas Neumann<br>
<b>Gesendet:</b> Donnerstag, 28. Juli 2016 18:14<br>
<b>An:</b> DelazJ<br>
<b>Cc:</b> QGIS User List<br>
<b>Betreff:</b> Re: [Qgis-user] Saving/Loading styles in Postgis<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">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?<o:p></o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On July 28, 2016 6:08:01 PM CEST, DelazJ <</span><a href="mailto:delazj@gmail.com"><span lang="EN-US">delazj@gmail.com</span></a><span lang="EN-US">> wrote:<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
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 QGIS.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">HTH,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Harrissou<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2016-07-28 17:38 GMT+02:00 Neumann, Andreas <<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>>:<o:p></o:p></p>
<div>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Hi,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">I have never used the Saving/Loading of styles in Postgis (see <a href="http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database" target="_blank">http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database</a>)<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Do I have to create a special styling table for it to enable this?<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">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 Postgis.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">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 myself?<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif"">Thank you for any hints!<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#888888">Andreas</span><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""><o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana","sans-serif""> <o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
-- <br>
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.<o:p></o:p></p>
</div>
</div>
</body>
</html>