From: Tom Lane <tgl@sss.pgh.pa.us>
To: jmcgraw@databill.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Dropped table screws referential integrity?
Date: Thu, 07 Mar 2002 13:37:40 -0500
Message-ID: <12454.1015526260@sss.pgh.pa.us> (raw)
In-Reply-To: <TradeClient.0.9.0.FreeBSD-4.2-RELEASE.0203070756222A.71014@jmcgraw.databill.com>
References: <TradeClient.0.9.0.FreeBSD-4.2-RELEASE.0203070756222A.71014@jmcgraw.databill.com>
Joel Mc Graw <jmcgraw@databill.com> writes:
> 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?
Drop the triggers on jobs that enforce the RI check. They should've
been dropped automatically, but I believe there used to be a bug in
pg_dump that caused the necessary linkage data not to be included in
dumps --- so if your DB has been dumped and reloaded since the triggers
were made, I'm not surprised you'd have got into this state.
See mail list archives of past discussions if you need help finding
the triggers (hint: look in pg_trigger, and beware that the triggers
you want to drop have mixed-case names which you will have to double
quote). There will be either one or two triggers to get rid of
depending on which end of the RI check this table was.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jmcgraw@databill.com
Subject: Re: Dropped table screws referential integrity?
In-Reply-To: <12454.1015526260@sss.pgh.pa.us>
References: <TradeClient.0.9.0.FreeBSD-4.2-RELEASE.0203070756222A.71014@jmcgraw.databill.com> <12454.1015526260@sss.pgh.pa.us>
* 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