Re: Small PosgreSQL locking function request - with bounty
От
Kevin Grittner
Тема
Re: Small PosgreSQL locking function request - with bounty
Дата
Msg-id
1379172586.30975.YahooMailNeo@web162901.mail.bf1.yahoo.com
Ответ на
Список
Дерево обсуждения
Small PosgreSQL locking function request - with bounty David Noel <david.i.noel@gmail.com>
Re: Small PosgreSQL locking function request - with bounty rob stone <floriparob@gmail.com>
Re: Small PosgreSQL locking function request - with bounty Ralf Schuchardt <rasc@gmx.de>
Re: Small PosgreSQL locking function request - with bounty David Noel <david.i.noel@gmail.com>
Re: Small PosgreSQL locking function request - with bounty rob stone <floriparob@gmail.com>
Re: Small PosgreSQL locking function request - with bounty Kevin Grittner <kgrittn@ymail.com>
Re: Small PosgreSQL locking function request - with bounty Ralf Schuchardt <rasc@gmx.de>
David Noel wrote: > I've read through the documentation, found a few examples using > "for update" syntax, and it looks like you're right. Would > transaction level SERIALIZABLE also work? It does seem messier > though, having to handle errors thrown due to concurrent > transactions. The SERIALIZABLE transaction isolation level, as implemented in PostgreSQL, would provide correct behavior; but is not a very efficient way to handling access to the ends of a queue. Regardless of the isolation level you use for other things, you probably want blocking around access to the ends of the queue -- or at least to the part where you pull an item from the queue for processing. The tricky part is likely to be making sure that if something is pulled from the queue it gets processed or gets put back onto the queue. Without careful planning you might risk either losing items or blocking not just for pulling off the queue, but all the way through processing. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-general по дате отправления