pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: chester c young <chestercyoung@yahoo.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: apparent RI bug
Date: Thu, 3 Apr 2008 10:31:19 -0700 (PDT)
Message-ID: <20080403102340.B14656@megazone.bigpanda.com> (raw)
In-Reply-To: <598841.46263.qm@web54306.mail.re2.yahoo.com>
References: <598841.46263.qm@web54306.mail.re2.yahoo.com>

On Wed, 2 Apr 2008, chester c young wrote:

> 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';

Yeah, that looks pretty broken. Can you reproduce this from a clean start
repeatedly or is this a one off? Do you ever turn off triggers, perhaps by
modifying the pg_class row's reltriggers (I'd guess the answer is no, but
it'd be good to make sure)?




view thread (7+ messages)  latest in thread

Message-ID: <20080403102340.B14656@megazone.bigpanda.com>
Permalink:  ../20080403102340.B14656@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20080403102340.B14656@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, chestercyoung@yahoo.com
  Subject: Re: apparent RI bug
  In-Reply-To: <20080403102340.B14656@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox