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

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

pgsql-bugs by date

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

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