Re: Stored Procedure and Trigger they puzzle me - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Stored Procedure and Trigger they puzzle me
Date
Msg-id 52EF20B2E3209443BC37736D00C3C1380BF426C7@EXADV1.host.magwien.gv.at
Whole thread Raw
In response to Stored Procedure and Trigger they puzzle me  (Lars Heidieker <lars@heidieker.de>)
Responses Re: Stored Procedure and Trigger they puzzle me  (Lars Heidieker <lars@heidieker.de>)
List 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

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Second attempt, roll your own autovacuum
Next
From: Hannes Dorbath
Date:
Subject: Don't split on underscore