QGIS/tests/testdata/provider/testdata_pg_domain.sql
Denis Rouzaud bfe35c26ea [postgres] use pg_type rather than information_schema.domain_constraints to retrieve domain
otherwise there is no warranty to retrieve the correct constraint as its name is not unique
2018-02-11 17:29:18 -04:00

26 lines
704 B
SQL

CREATE DOMAIN public.colordomain
AS text
COLLATE pg_catalog."default"
CONSTRAINT domainconstraint CHECK (VALUE = ANY (ARRAY['red'::text, 'green'::text, 'blue'::text]));
CREATE DOMAIN qgis_test.colordomain
AS text
COLLATE pg_catalog."default"
CONSTRAINT domainconstraint CHECK (VALUE = ANY (ARRAY['yellow'::text, 'cyan'::text, 'magenta'::text]));
CREATE DOMAIN qgis_test.flowerdomain
AS text
COLLATE pg_catalog."default"
CONSTRAINT domainconstraint CHECK (VALUE = ANY (ARRAY['Alchemilla'::text, 'Alstroemeria'::text, 'Alyssum'::text]));
CREATE TABLE qgis_test.colors
(
id SERIAL NOT NULL,
color_public colordomain,
color_qgis qgis_test.colordomain,
flower qgis_test.flowerdomain
)