Skip to content

Instantly share code, notes, and snippets.

@st98
Last active August 29, 2015 14:14
Show Gist options
  • Save st98/5085e921d175cc85ef74 to your computer and use it in GitHub Desktop.
Save st98/5085e921d175cc85ef74 to your computer and use it in GitHub Desktop.
check 制約。
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