Re: [GENERAL] Using xmin and xmax for optimistic locking

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: [GENERAL] Using xmin and xmax for optimistic locking
Дата
Msg-id 20170220194712.ltaxw64j3spytagk@hermes.hilbert.loc
обсуждение исходный текст
Ответ на [GENERAL] Using xmin and xmax for optimistic locking  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Список pgsql-general
On Mon, Feb 20, 2017 at 07:27:34PM +0000, Rakesh Kumar wrote:

> I tested it and it works.  what I did was to select xmin and xmax and then sleep for a min.
> In the meantime, I update the same row in another session.
> After 1 min the update session failed to update any row because the combination of xmin
> and xmax was no longer true.
>
> I was under the impression that xmin/xmax can not be used in the where clause for business logic as described above.
>
> Am I missing anything ?  If this works, it can make optimistic locking lot easier due to generic coding using
xmin/xmax.

Works fine.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346


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

Предыдущее
От: Rakesh Kumar
Дата:
Сообщение: [GENERAL] Using xmin and xmax for optimistic locking
Следующее
От: Gabriel Ortiz Lour
Дата:
Сообщение: Fwd: [GENERAL] Streaming Replication Without Downtime