Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure? - Mailing list pgsql-general

From Tom Lane
Subject Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Date
Msg-id 28976.1265863347@sss.pgh.pa.us
Whole thread Raw
In response to Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?  ("Wang, Mary Y" <mary.y.wang@boeing.com>)
List pgsql-general
"Wang, Mary Y" <mary.y.wang@boeing.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

pgsql-general by date:

Previous
From: "Wang, Mary Y"
Date:
Subject: Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Next
From: Greg Smith
Date:
Subject: Re: Memory Usage and OpenBSD