Re: orphaned trigger - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: orphaned trigger
Date
Msg-id Pine.BSF.4.21.0105161628310.30350-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: orphaned trigger  ("Jonathan Ellis" <jellis@advocast.com>)
List pgsql-bugs
On Wed, 16 May 2001, Jonathan Ellis wrote:

> > > Would manually
> > > removing it from pg_trigger cause Bad Things to happen?
> >
> > Yes, and you'll need to double quote the trigger name.
> > try
> > drop trigger "RI_ConstraintTrigger_44349" on users;
>
> That worked.  Why was that?

It's a mixed case thing.  The name of the constraint is actually
RI_ConstraintTrigger_44349 (with that casing).  When you specify
it without the quotes, postgres lowercases it to
ri_constrainttrigger_44349 and fails to find it.

> > How did you drop the table?  Did you reload a dump file (like the one that
> > referenced it)?
>
> I'm afraid I don't understand the question.  I dropped it with drop table.
> Although thinking back on it, the drop may have been on 7.0.2.  Can't
> remember whether that was before or after upgrading...

Wait, okay, I think I know what happened.  There was a problem with 7.0.?
dumps not having the information about the "other" table in the references
constraint written out so when you dropped the table it didn't realize
it needed to drop the trigger.  You may want to drop the constraint
triggers and recreate them with alter table add constraint.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: date bug
Next
From: Tom Lane
Date:
Subject: Re: Unusual slowdown using subselects