Re: Possible bug in referential integrity system

From: "Alexei E Korneyev" <alexei(at)niva(dot)sposad(dot)ru>
To: "pgsql-BUGS" <pgsql-bugs(at)postgresql(dot)org>, <rellis(at)erols(dot)com>
Subject: Re: Possible bug in referential integrity system
Date: 2000-09-06 05:42:59
Message-ID: 002601c017c5$50f4f1c0$03b51ed4@niva.sposad.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)niva(dot)sposad(dot)ru

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2000-09-06 06:57:34 bug in date_part() function in 6.5.2, 7.0.2
Previous Message pgsql-bugs 2000-09-06 04:31:19 /usr/include/pgsql/os.h does not exist