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


Your name               : Ernest E Vogelsinger
Your email address      : [EMAIL PROTECTED]


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
([EMAIL PROTECTED])
                                                  (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
    ^


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to