BUG: RI not enforced on inherited foreign keys (v.7.2.1)

From: "Ernest E Vogelsinger" <ernest(dot)vogelsinger(at)eventus(dot)at>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: BUG: RI not enforced on inherited foreign keys (v.7.2.1)
Date: 2002-08-02 16:09:37
Message-ID: JIENKDKCHMIFIKFKPHDJMEMJCAAA.ernest.vogelsinger@eventus.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Ernest E Vogelsinger
Your email address : ernest(at)vogelsinger(dot)at

System Configuration
---------------------
Architecture (example: Intel Pentium) : 2 x Intel Pentium 4

Operating System (example: Linux 2.0.26 ELF) : Linux version 2.4.9-34smp
(bhcompile(at)daffy(dot)perf(dot)redhat(dot)com)
(gcc version 2.96 20000731
(Red Hat Linux 7.2 2.96-108.1))
#1 SMP Sat Jun 1 06:15:25 EDT 2002

PostgreSQL version (example: PostgreSQL-7.2.1): PostgreSQL-7.2.1

Compiler used (example: gcc 2.95.2) : RedHat RPM

Please enter a FULL description of your problem:
------------------------------------------------

There is a severe problem with foreign keys that are inherited:
RI is NOT enforced on inherited foreign keys.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

create table tb1 (
id serial primary key
);

create table tb2 (
id serial primary key,
id_tb1 integer references tb1(id),
id_tb2 integer references tb2(id)
);

create table tb2a (
data varchar
) inherits(tb2);

-- these two return an error (correct)
insert into tb2(id_tb1) values (999);
insert into tb2(id_tb2) values (999);

-- but these two work (WRONG!!)
insert into tb2a(id_tb1) values (999);
insert into tb2a(id_tb2) values (999);

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Sorry, no idea :) but it certainly needs to be fixed...

>O Ernest E. Vogelsinger
(\) ICQ# 13394035
^

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2002-08-02 18:26:37 Re: Case bug in SQL Constraint
Previous Message Tom Lane 2002-08-02 14:04:26 Re: [PORTS] make check fails -- 8 hour time difference in old dates