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

From: "Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Date: 2010-02-11 00:56:21
Message-ID: FA20D4C4FEBFD148B1C0CB09913825FC01EBDA2F99@XCH-SW-06V.sw.nos.boeing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Hmm. Things are still getting interesting around here.

Here is my complicated problem. I tried to delete a user from my users table, but it said
"ERROR: bug_assigned_to_fk referential integrity violation - key in users still referenced from bug"
Ok.
Then I saw this statement in the .sql file.
"CREATE CONSTRAINT TRIGGER "bug_assigned_to_fk" AFTER DELETE ON "users" FROM "bug" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_del" ('bug_assigned_to_fk', 'bug', 'users', 'FULL', 'assigned_to', 'user_id');"
Then I used this command to delete the constraint trigger:
" drop trigger bug_assign_to_fk on bug;"
I received error:
"ERROR: DropTrigger: there is no trigger bug_assign_to_fk on relation bug"
I also tried
"drop trigger bug_assign_to_fk on user;"
I received this error:
"ERROR: DropTrigger: there is no trigger bug_assign_to_fk on relation users"

Here is the bug table. Please NOTE there is no constraint listed in the bug table.

\d bug
Table "bug"
Attribute | Type | Modifier
---------------+---------+----------------------------------------------
bug_id | integer | not null default nextval('bug_pk_seq'::text)
group_id | integer | not null default '0'
status_id | integer | not null default '0'
priority | integer | not null default '0'
category_id | integer | not null default '0'
submitted_by | integer | not null default '0'
assigned_to | integer | not null default '0'
date | integer | not null default '0'
summary | text |
details | text |
close_date | integer |
bug_group_id | integer | not null default '0'
resolution_id | integer | not null default '0'
Indices: bug_group_id,
bug_groupid_assignedto_statusid,
bug_groupid_statusid,
bug_pkey

Any ideas on how can I drop the bug_assigned_to_fk trigger so that I can remove an user?

Any help is appreciated.
Mary

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2010-02-11 01:10:16 Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Previous Message paul e 2010-02-11 00:15:56 windows7 login- user account