FK to inherited table, referential integrity violation

From: yacht(at)seznam(dot)cz
To: pgsql-general(at)postgresql(dot)org
Subject: FK to inherited table, referential integrity violation
Date: 2003-08-20 18:58:33
Message-ID: 20030820185833.GC28215@lgm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it bug?

CREATE TABLE base ( base INT PRIMARY KEY );
CREATE TABLE child ( val INT ) INHERITS ( base );
CREATE TABLE ref (
atr INT
, base INT REFERENCES base ON UPDATE cascade ON DELETE cascade );

INSERT INTO child VALUES ( 1, 2 );

SELECT * FROM base;
base
------
1

SELECT * FROM child;
base | val
------+-----
1 | 2

INSERT INTO ref VALUES ( 3, 1 );

ERROR: $1 referential integrity violation - key referenced from ref not
found in base

--
oo don't worry
\__/ be happy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2003-08-20 19:02:59 Re: Grouping by date range
Previous Message Bruno Wolff III 2003-08-20 18:58:27 Re: Grouping by date range