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

Поиск
Список
Период
Сортировка
От Wang, Mary Y
Тема Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?
Дата
Msg-id FA20D4C4FEBFD148B1C0CB09913825FC01EBDA2F9F@XCH-SW-06V.sw.nos.boeing.com
обсуждение исходный текст
Ответ на Re: How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
Yes.  I do want to keep that information in the bug : assigned_to=user_id
Yes. I'm embrassed to say it's still in 7.1.3. I know, I know that I need to upgrade, but I do need to fix a problem
now.
\d+ bug returns
                                     Table "bug"
   Attribute   |  Type   |                   Modifier                   | Descript                  ion
---------------+---------+----------------------------------------------+---------                  ----
 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


-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Wednesday, February 10, 2010 5:10 PM
To: pgsql-general@postgresql.org
Cc: Wang, Mary Y
Subject: Re: [GENERAL] How do I drop a Complicated Constraint Trigger After Delete Execute Procedure?

On Wednesday 10 February 2010 4:56:21 pm Wang, Mary Y wrote:
> 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.

Why not try deleting the information in bug that had assigned_to=user_id? Or do you want to keep that info in bug?

Is this still in version 7.1?

> 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

How about \d+ bug ?


> Mary



--
Adrian Klaver
adrian.klaver@gmail.com

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

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