Feature request #17265

Choosing 'layer_styles' schema

Added by Frédéric CLOITRE over 6 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Data Provider
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:25163

Description

For projects with shared spatial databases, it would be interesting to add the ability to choose the default schema to store the layer_styles table. In cases where each user has his own schema, there is no direct possibility to share the styles saved by default. layer_styles is created independently in each of the user shcemas.

In my situation, I had to work around this constraint by creating views of a single public.layer_styles table for each user and automatically executed rules for the insert, update, delete actions to automatically save the new data in the main table public.layer_styles (cf. attachement). Regarding to source code: https://github.com/qgis/QGIS/blob/8deed6c49742bf01d4d49a369fe52a7100fcf107/src/providers/postgres/qgspostgresprovider.cpp

Sincerely.

qgis_layer_style.sql - Rules to share layer_styles between postgresql users (5.38 KB) Frédéric CLOITRE, 2017-10-10 01:14 AM

Also available in: Atom PDF