RE: User locks code

Поиск
Список
Период
Сортировка
От Mikheev, Vadim
Тема RE: User locks code
Дата
Msg-id 3705826352029646A3E91C53F7189E32016746@sectorbase2.sectorbase.com
обсуждение исходный текст
Ответ на User locks code  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
Ответы Re: RE: User locks code  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> yep:
> lock "tablename.colname.val=1"
> select count(*) from tablename where colname=1
> If no rows, insert, else update.
> (dunno if the locks would scale to a scenario with hundreds
> of concurrent inserts - how many user locks max?).

I don't see problem here - just a few bytes in shmem for
key. Auxiliary table would keep refcounters for keys.

> Why wouldn't it work with serializable isolevel?

Because of selects see old database snapshot and so you
wouldn't see key inserted+committed by concurrent tx.

Vadim


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Link to bug webpage
Следующее
От: Vince Vielhaber
Дата:
Сообщение: Re: Link to bug webpage