Re: Possible bug in referential integrity system
Alexei E Korneyev <alexei@niva.sposad.ru>
From: "Alexei E Korneyev" <alexei@niva.sposad.ru>
To: "pgsql-BUGS" <pgsql-bugs@postgresql.org>, <rellis@erols.com>
Date: 2000-09-06T05:42:59Z
Lists: pgsql-bugs
Hello! Keys phrase 'NOT NULL' simple=# create table t1 (num int4 PRIMARY KEY, name text); NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 't1_pkey' for table 't1' CREATE simple=# create table t2 (ref int4 references t1 (num) NOT NULL, val text); NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) CREATE simple=# insert into t1 values (1, 'Widget1'); INSERT 80324 1 simple=# insert into t2 values ( (select num from t1 where name = 'widget2'), 'Bug?'); ERROR: ExecAppend: Fail to add null value in not null attribute ref > => create table t1 (num int4, name text); > CREATE > => create table t2 (ref int4 references t1 (num), val text); > NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) > CREATE > > => insert into t1 values (1, 'Widget1'); > INSERT 17518650 1 > > => insert into t2 values ( (select num from t1 where name = 'Widget1'), 'Valuable'); > INSERT 17518651 1 > => insert into t2 values ( (select num from t1 where name = 'widget2'), 'Bug?'); > INSERT 17518652 1 Alexei E. Korneyev alexei@niva.sposad.ru