Re: Stored Procedure and Trigger they puzzle me

From: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
To: "Lars Heidieker *EXTERN*" <lars(at)heidieker(dot)de>
Cc: "Alban Hertroys" <alban(at)magproductions(dot)nl>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Stored Procedure and Trigger they puzzle me
Date: 2006-12-19 11:44:23
Message-ID: 52EF20B2E3209443BC37736D00C3C1380BF426C7@EXADV1.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Actually I just figured out, that is is not the trigger but the two
> cascade on update triggers collide.
> It happens also without the trigger:
>
> lt=# UPDATE ltlocation SET id = 45555 WHERE id = 18999;
> ERROR: insert or update on table "ltlocationpath" violates foreign
> key constraint "ltlocancester_fkey"
> DETAIL: Key (ltlocancester_id)=(18999) is not present in table
> "ltlocation".
> CONTEXT: SQL statement "UPDATE ONLY "public"."ltlocationpath" SET
> "ltlocation_id" = $1 WHERE "ltlocation_id" = $2"
>
> I think the two foreign key constraints together make it impossible
> to change the primary key (which isn't needed),
> as they would have to run "as one" which they can't...

The two foreign key constraints worked fine when I tried them,
the only problem was the trigger.

I don't get what you describe.

Have you changed anything in the definitions?

If yes, post table, key, and trigger definitions as you have them now.

Yours,
Laurenz Albe

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2006-12-19 12:24:01 Re: Let's play bash the search engine
Previous Message Alvaro Herrera 2006-12-19 11:25:27 Re: Second attempt, roll your own autovacuum