Re: dataset lock
От | Albe Laurenz |
---|---|
Тема | Re: dataset lock |
Дата | |
Msg-id | A737B7A37273E048B164557ADEF4A58B057E8254@ntex2010a.host.magwien.gv.at обсуждение исходный текст |
Ответ на | Re: dataset lock (Philipp Kraus <philipp.kraus@flashpixx.de>) |
Список | pgsql-general |
Philipp Kraus wrote: >> Do you want to implement something like a queue? > > Yes >> You get a few rows by >> UPDATE table SET status = processing WHERE id IN >> (SELECT id FROM table WHERE status = waiting >> ORDER BY id LIMIT 5) RETURNING *; >> Then process and update the rows. >> >> This won't block concurrent processes for the whole >> time it takes to process the rows, so it's probably >> closer to what you want. > > The marker solution seems to be the correct idea, I must think about it. > Would you create the call within a stored procedure (and call the SP > from the client) or would you use the > statement from a client direct? I don't think it matters - use what is most constistent with your taste and architecture. Yours, Laurenz Albe
В списке pgsql-general по дате отправления: