apparent RI bug

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: apparent RI bug
Date: 2008-04-02 17:42:36
Message-ID: 598841.46263.qm@web54306.mail.re2.yahoo.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

it appears I have a broken RI in my db.

call_individual.clh_id references call_household.clh_id

\d call_individual
...
Foreign-key constraints:
"call_individual_clh_id_fkey" FOREIGN KEY (clh_id) REFERENCES
call_household(clh_id) ON DELETE CASCADE

however:
development=# select clh_id from call_individual cli where not exists(
select 1 from call_household clh where clh.clh_id=cli.clh_id );
clh_id
--------
14691

should not matter, but call_individual has a pre-delete trigger that
simply raises an exception to prevent deletions:
raise exception 'calls may not be deleted';

____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ivan Sergio Borgonovo 2008-04-02 20:47:53 update with join
Previous Message Emi Lu 2008-04-02 14:21:48 A sys func for a->b, b->c => a->c ?