Thread: two constrains for one column

two constrains for one column

From
Ben-Nes Michael
Date:
Hi All

im trying to do the next thing, is it possible ?

CREATE TABLE language (
language serial PRIMARY KEY,
shortcut char(2) NOT NULL, unique, -- like il,en,fr,sp
);



Re: two constrains for one column

From
"Dr. Evil"
Date:
Yes, definitely.  Just do:

CREATE TABLE language (
language serial PRIMARY KEY,
shortcut char(2) NOT NULL UNIQUE -- like il,en,fr,sp
);

and it should be fine.

Constraints are good.