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

reference to inherited column in parent

From: "Rumi Szabolcs" <szrumi(at)matavnet(dot)hu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: reference to inherited column in parent
Date: 2001-10-27 06:08:13
Message-ID: 200110270808130680.00D629F6@mail.local (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello!

i experienced the following problem with postgresql:

---8<-------------------------------------

=# create table parent (a integer unique not null);
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'parent_a_key' for table 'parent'
CREATE
=# create table child (b integer) inherits (parent);
CREATE
=# create table other (c integer references parent (a));
NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
=# insert into child values (1, 2);
INSERT 53863 1
=# insert into other values (1);
ERROR:  <unnamed> referential integrity violation - key referenced from other not found in parent
=# select * from parent;
 a
---
 1
(1 row)

---8<-------------------------------------

i am really far from having a clue about pgsql, but this doesn't
seem to be the correct behaviour to me, i don't know whether
this is accidental or not...

Regards,

Szabolcs Rumi


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-10-27 07:05:34
Subject: Bug #492: corrupt pg_language_oid_index, (how to fix?)
Previous:From: Marcelo (AdSolutions)Date: 2001-10-26 18:34:12
Subject: Problems when inserting a very large sequence of records

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