Carlos Fonseca wrote:
>
> I have sent this message to pgsql-general and so far received no reply.
> This bug seems to be 100% reproducible on Linux (i386 and sparc). If this
> problem is specific to Debian, then it would help me to know that, too.
>
> Cascaded updates tend to write old data on top of new, as the following
> minimal example shows:
Unfortunately, when I wrote refint.c ~ 2.5 years ago I used
DELETE for both cascade UPDATE and DELETE. I don't remember why.
Massimo Lambertini (massimo.lambertini@everex.it) changed
refint.c to performe UPDATE of foreign keys on UPDATE of primary
ones, but he did error: he uses 1st update new primary key value
in UPDATE _foreign_table_ SET and so execution plan is prepared,
saved, used with this value. Paramater ($1...$n) should be used there.
I have no time to fix it, sorry. Ask him or learn PL/pgSQL and write
trigger youself.
Vadim