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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Дата
Msg-id 25229.1265855411@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?  ("Wang, Mary Y" <mary.y.wang@boeing.com>)
Ответы Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?  ("Wang, Mary Y" <mary.y.wang@boeing.com>)
Список pgsql-general
"Wang, Mary Y" <mary.y.wang@boeing.com> writes:
> 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
IMMEDIATEFOR 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"

It looks to me like you misspelled the trigger name --- what you
quote there is bug_assigned_to_fk not bug_assign_to_fk.  Also, the
trigger is attached to table users not table bug.

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

I think in 7.1 that trigger would be shown as a trigger if you did \d users,
but it's not going to be mentioned by \d bug.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Koichi Suzuki
Дата:
Сообщение: Re: Problem with pg_compresslog'd archives
Следующее
От: "Wang, Mary Y"
Дата:
Сообщение: Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?