Re: Dropped table screws referential integrity?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jmcgraw(at)databill(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Dropped table screws referential integrity?
Date: 2002-03-07 18:37:40
Message-ID: 12454.1015526260@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Joel Mc Graw <jmcgraw(at)databill(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Joel Burton 2002-03-07 19:08:19 Re: Dropped table screws referential integrity?
Previous Message Jodi Kanter 2002-03-07 17:27:36 Fw: --fast switch