Re: Per-Table Transaction Isolation Level?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Per-Table Transaction Isolation Level?
Дата
Msg-id 20041109040552.GA20532@surnet.cl
обсуждение исходный текст
Ответ на Per-Table Transaction Isolation Level?  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-general
On Tue, Nov 09, 2004 at 04:34:16AM +0100, Florian G. Pflug wrote:

> My import sometimes crashed, becausse the meta-information tables are
> changed while importing (e.h, I pass a id to a function, the function
> does some calculations, than tries to select the row with the given id,
> but fails, because the row was deleted in the meantime). I understand
> that the standard approach to this problem is to set the transaction
> isolation level to "serializeable", thus avoiding non-repeatable reads.

Sounds like you could use savepoints to be able to retry without
starting from scratch:

- function gets the Id
- savepoint foo
- do something with Id
- try to get row == Id
  - if it doesn't exist, rollback to foo, go to top
- release foo
- go to top

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Uno combate cuando es necesario... ¡no cuando está de humor!
El humor es para el ganado, o para hacer el amor, o para tocar el
baliset.  No para combatir."  (Gurney Halleck)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: server auto-restarts and ipcs
Следующее
От: "Ed L."
Дата:
Сообщение: Re: server auto-restarts and ipcs