Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Date: 2010-02-11 04:42:27
Message-ID: 28976.1265863347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com> writes:
> I got something here :
> select * from pg_trigger where tgconstrname = 'bug_assigned_to_fk';
> tgrelid | tgname | tgfoid | tgtype | tgenabled | tgisconstr aint | tgconstrname | tgconstrrelid | tgdeferrable | tginitdeferred | tgnarg s | tgattr | tgargs
> ---------+------------------------------+--------+--------+-----------+----------- -----+--------------------+---------------+--------------+----------------+------- --+--------+---------------------------------------------------------------------- ----
> 7335118 | RI_ConstraintTrigger_9217018 | 1655 | 17 | t | t | bug_assigned_to_fk | 7329978 | f | f | 6 | | bug_assigned_to_fk\000bug\000users\000FULL\000assigned_to\000user_id\ 000
> 7335118 | RI_ConstraintTrigger_9217016 | 1654 | 9 | t | t | bug_assigned_to_fk | 7329978 | f | f | 6 | | bug_assigned_to_fk\000bug\000users\000FULL\000assigned_to\000user_id\ 000
> 7329978 | RI_ConstraintTrigger_9217014 | 1644 | 21 | t | t | bug_assigned_to_fk | 7335118 | f | f | 6 | | bug_assigned_to_fk\000bug\000users\000FULL\000assigned_to\000user_id\ 000
> (3 rows)

Ah, right ... if memory were better, I'd have remembered that FK
triggers used to be named like this. Try

drop trigger "RI_ConstraintTrigger_9217018" on bugs;

and so forth. I'm not sure which of the three triggers are
on which of the two tables, but it won't take you long to
find out. (And yes, you need those double quotes.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2010-02-11 06:20:25 Re: Memory Usage and OpenBSD
Previous Message Wang, Mary Y 2010-02-11 04:38:07 Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?