Re: Summary table trigger example race condition

Поиск
Список
Период
Сортировка
От Mark Kirkwood
Тема Re: Summary table trigger example race condition
Дата
Msg-id 43C46B09.8080300@paradise.net.nz
обсуждение исходный текст
Ответ на Re: Summary table trigger example race condition  (Mark Kirkwood <markir@paradise.net.nz>)
Список pgsql-patches
Mark Kirkwood wrote:
> Jim C. Nasby wrote:
>
>> On Sun, Jan 08, 2006 at 04:13:01PM +1300, Mark Kirkwood wrote:
>>
>>
>>
>> What happens if someone deletes the row between the failed insert and
>> the second update? :)
>>
>
> In this example the rows in the summary table never get deleted by
> DELETE operations on that main one - the trigger just decrements the
> various amounts - i.e DELETE becomes UPDATE, so no problem there.
>

Sorry Jim, I just realized you probably meant someone directly deleting
rows in the summary table itself. Well yes, that would certainly fox it!

I guess I was implicitly considering a use case where the only direct
DML on the summary table would be some sort of ETL process, which would
probably lock out other changes (and re-create the summary table data
afterwards in all likelihood).

Cheers

Mark

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: TODO-item: Add sleep() function, remove from regress.c
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TODO-item: Add sleep() function, remove from regress.c