Storing QGIS Styling in SDW 1.5

Open pgAdmin III and connect to your SDW as an Admin User and check the public schema for a layer_styles table. If it does not exist then open a SQL window and run the following:

CREATE TABLE public.layer_styles

(
  id serial NOT NULL,
  f_table_catalog character varying,
  f_table_schema character varying,
  f_table_name character varying,
  f_geometry_column character varying,
  stylename character varying(30),
  styleqml xml,
  stylesld xml,
  useasdefault boolean,
  description text,
  "owner" character varying(30),
  ui xml,
  update_time timestamp without time zone DEFAULT now(),
  CONSTRAINT layer_styles_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.layer_styles OWNER TO "sdw_owner";
GRANT ALL ON TABLE public.layer_styles TO "sdw_owner";
GRANT SELECT, INSERT, DELETE, UPDATE ON TABLE public.layer_styles TO staff;
GRANT SELECT, UPDATE ON SEQUENCE public.layer_styles_id_seq TO staff;

If the table already exists then check the grants and if they don't match the last four entries above then just run these.

Once the table has been created you can save your styles in QGIS to your PostgreSQL database e.g.