Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* CHECK制約 [#ec240373]
CREATE TABLE t1 ( gender TEXT CHECK ( gender IN ( 'man',...
=> genderカラムにCHECK制約を設定
INSERT INTO t1 VALUES ( 'man' );
=> OK
INSERT INTO t1 VALUES ( 'woman' );
=> OK
INSERT INTO t1 VALUES ( 'foo' );
ERROR: new row for relation "t1" violates check constra...
DETAIL: Failing row contains (foo).
** テーブル定義 [#k81f8029]
テーブル "public.t1"
列 | 型 | 修飾語
--------+------+--------
gender | text |
検査制約:
"t1_gender_check" CHECK (gender = ANY (ARRAY['man'::...
** 参考 [#y8ae877c]
https://www.postgresql.org/docs/current/ddl-constraints.h...
終了行:
* CHECK制約 [#ec240373]
CREATE TABLE t1 ( gender TEXT CHECK ( gender IN ( 'man',...
=> genderカラムにCHECK制約を設定
INSERT INTO t1 VALUES ( 'man' );
=> OK
INSERT INTO t1 VALUES ( 'woman' );
=> OK
INSERT INTO t1 VALUES ( 'foo' );
ERROR: new row for relation "t1" violates check constra...
DETAIL: Failing row contains (foo).
** テーブル定義 [#k81f8029]
テーブル "public.t1"
列 | 型 | 修飾語
--------+------+--------
gender | text |
検査制約:
"t1_gender_check" CHECK (gender = ANY (ARRAY['man'::...
** 参考 [#y8ae877c]
https://www.postgresql.org/docs/current/ddl-constraints.h...
ページ名: