Home Constraint in array character elements in PostgreSQL
Reply: 0

Constraint in array character elements in PostgreSQL

user534
1#
user534 Published in April 24, 2018, 10:14 pm

In PostgreSQL 10.1 I create the following table:

CREATE TABLE nationality_cumulative_criteria
(
    id             smallint NOT NULL,
    country_set    character varying(2)[] NOT NULL,
    number         smallint NOT NULL
);

I wish to add a constraint (exclude) which will not allow, for example, "US" to appear in different tuples but only in one.

I have already checked and found only cases with ranges and functions but not with arrays of character elements.

Tia

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.555477 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO