Store QGIS Styling in SDW v2.0

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 "astun";
GRANT ALL ON TABLE public.layer_styles TO "astun";
GRANT SELECT, INSERT, DELETE, UPDATE ON TABLE public.layer_styles TO sdw_staff;
GRANT SELECT, UPDATE ON SEQUENCE public.layer_styles_id_seq TO sdw_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.