Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group