Re: [Qgis-user] Saving/Loading styles in Postgis
Hi Burghardt, Thanks for the hint. I will keep an eye on dump and restore regarding the XMLParser. That sounds like an annoying workaround. Hopefully there can be a better solution rather than having to edit dump files before restores. This is a completely new, self-compiled PostgresQL/Postgis server with all the newest libraries and versions. Obviously, when compiling, I missed the XML bit - because personally I did not need XML support so far. Looking forward to get this working, Andreas On 2016-07-29 07:52, burghardt.scho...@stadt.wolfsburg.de wrote: > Hi Andreas, > > To save the layer styles in a PG table is a cool feature J. 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;". > > Regards > > Burghardt > > 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 wrote: > > Hi, > 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. > > 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. > > HTH, > > Harrissou > > 2016-07-28 17:38 GMT+02:00 Neumann, Andreas : > > Hi, > > I have never used the Saving/Loading of styles in Postgis (see > http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database) > > > 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 > Postgis. > > 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? > > Thank you for any hints! > > Andreas > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-user [1] > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user [1] > > -- > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. Links: -- [1] http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Saving/Loading styles in Postgis
Hi, ok - answering myself: In the Postgis "Log Messages Panel" I get a hint: - [ERROR: unsupported XML feature DETAIL: This functionality requires the server to be built with libxml support. HINT: You need to rebuild PostgreSQL using --with-libxml. ] - So I need to recompile my PG Server and add support for libxml. Andreas On 2016-07-29 08:54, Neumann, Andreas wrote: > Hi, > > Ok - I further investigated. It is not an issue of using services in the PG > connection. Still having troubles saving styles in PG. > > I created new connections with a PG admin user. I dropped the layer_styles > table from the public schema. > > When I save a style in PostgreSQL, the new empty table is created (so it > can't be a permission thing because the user can create new tables) but then > again the I get the error message: > > "Unabe to save layer style. It's not possible to insert a new record in to > the style table. Maybe this is due to table permissions (user=xxx). Please > contact your database administrator." > > > > I then also made sure that everybody can write to that table and that I don't > use special characters in the style name. > > What else could it be? > > Thanks, > > Andreas > > On 2016-07-28 18:13, Andreas Neumann wrote: 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 wrote: > > Hi, > 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. > > 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. > > HTH, > Harrissou > > 2016-07-28 17:38 GMT+02:00 Neumann, Andreas : > > Hi, > > I have never used the Saving/Loading of styles in Postgis (see > http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database) > > > 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 > Postgis. > > 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? > > Thank you for any hints! > > Andreas > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > 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 Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Saving/Loading styles in Postgis
Hi, Ok - I further investigated. It is not an issue of using services in the PG connection. Still having troubles saving styles in PG. I created new connections with a PG admin user. I dropped the layer_styles table from the public schema. When I save a style in PostgreSQL, the new empty table is created (so it can't be a permission thing because the user can create new tables) but then again the I get the error message: "Unabe to save layer style. It's not possible to insert a new record in to the style table. Maybe this is due to table permissions (user=xxx). Please contact your database administrator." I then also made sure that everybody can write to that table and that I don't use special characters in the style name. What else could it be? Thanks, Andreas On 2016-07-28 18:13, Andreas Neumann wrote: > 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 wrote: > > Hi, > 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. > > 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. > > HTH, > Harrissou > > 2016-07-28 17:38 GMT+02:00 Neumann, Andreas : > > Hi, > > I have never used the Saving/Loading of styles in Postgis (see > http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database) > > > 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 > Postgis. > > 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? > > Thank you for any hints! > > Andreas > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > 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 Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Saving/Loading styles in Postgis
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;”. Regards Burghardt 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 mailto:del...@gmail.com>> wrote: Hi, 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. 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. HTH, Harrissou 2016-07-28 17:38 GMT+02:00 Neumann, Andreas mailto:a.neum...@carto.net>>: Hi, I have never used the Saving/Loading of styles in Postgis (see http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database) 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 Postgis. 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? Thank you for any hints! Andreas ___ Qgis-user mailing list Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org> 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 Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Saving/Loading styles in Postgis
Hi, 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. 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. HTH, Harrissou 2016-07-28 17:38 GMT+02:00 Neumann, Andreas : > Hi, > > I have never used the Saving/Loading of styles in Postgis (see > http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database > ) > > 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 Postgis. > > 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? > > Thank you for any hints! > > Andreas > > > > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user > ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
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 wrote: >Hi, >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. > >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. > >HTH, >Harrissou > >2016-07-28 17:38 GMT+02:00 Neumann, Andreas : > >> Hi, >> >> I have never used the Saving/Loading of styles in Postgis (see >> >http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database >> ) >> >> 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 Postgis. >> >> 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? >> >> Thank you for any hints! >> >> Andreas >> >> >> >> >> ___ >> Qgis-user mailing list >> Qgis-user@lists.osgeo.org >> 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 Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Saving/Loading styles in Postgis
Hi, I have never used the Saving/Loading of styles in Postgis (see http://docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/vector_properties.html#storing-style-in-a-file-or-a-database) 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 Postgis. 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? Thank you for any hints! Andreas ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user