Re: Dropped table screws referential integrity?

From: Joel Burton <joel(at)joelburton(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Joel Mc Graw <jmcgraw(at)databill(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Dropped table screws referential integrity?
Date: 2002-03-07 19:08:19
Message-ID: Pine.LNX.4.30.0203071407500.21737-100000@temp.joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 7 Mar 2002, Stephan Szabo wrote:

>
> On Thu, 7 Mar 2002, Joel Mc Graw wrote:
>
> > I had a table (job_documents) that referenced another (jobs). I no
> > longer needed job_documents, so I dropped it. Now, any attempt to
> > delete rows from jobs fails--it complains that job_documents doesn't
> > exist. Is there a way to fix this?
>
> You'll need to find the two triggers on jobs that reference job_documents
> (do a select * from pg_trigger and look at the argument list to find
> them) and drop them and you should be fine.

In techdocs.postgresql.org, I have a HOWTO on referential integrity that
provides some views that make it easier to find the ref rules in effect in
your tables. These are helpful for debugging.

--

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Self 2002-03-07 19:59:00 Re: Fw: --fast switch
Previous Message Tom Lane 2002-03-07 18:37:40 Re: Dropped table screws referential integrity?