Re: [HACKERS] (Debian Bug#41223) cascaded updates with refint insert bogus data

Поиск
Список
Период
Сортировка
От Vadim Mikheev
Тема Re: [HACKERS] (Debian Bug#41223) cascaded updates with refint insert bogus data
Дата
Msg-id 3793EACE.444630D3@krs.ru
обсуждение исходный текст
Ответ на (Debian Bug#41223) cascaded updates with refint insert bogus data  (Carlos Fonseca <cmfonsec@ualg.pt>)
Список pgsql-hackers
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


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Re: [HACKERS] Counting bool flags in a complex query
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: selectivity calculation for or_clause is wrong ?