Last active
August 29, 2015 14:14
-
-
Save st98/5085e921d175cc85ef74 to your computer and use it in GitHub Desktop.
check 制約。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table t (a int check(a > 5)); | |
insert into t values (1); -- Error: CHECK constraint failed: t | |
----- | |
create table a(x int); | |
insert into a values ('hoge'); | |
insert into a values (5); | |
select * from a; -- hoge 5 | |
----- | |
create table b(x int check(typeof(x) is 'integer')); | |
insert into b values ('hoge'); -- Error: CHECK constraint failed | |
insert into b values (5); | |
select * from b; -- 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment