Re: BUG #6258: Lock Sequence

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: BUG #6258: Lock Sequence
Дата
Msg-id CAJKUy5jHxRa7hYZFSgk-+oVGLdtsh5JcG1HuPU_WPTP_QmCqAQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #6258: Lock Sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #6258: Lock Sequence  (Laerson keler <laerson.keler@lkmc.com.br>)
Список pgsql-bugs
On Mon, Oct 17, 2011 at 2:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> There really is not any way to generate guaranteed-hole-free sequences
> using sequence objects. =A0If you have to have that, I'd suggest locking
> the table against other writes and then fetching MAX(id) + 1. =A0It's not
> very fast, and it's not at all concurrent, but that's the price of
> ensuring no holes. =A0Personally I'd rethink how badly you need that
> property.
>

another option is to create a table to use as a sequence, and lock
that table everytime you need a new value... is not concurrent also,
but at least faster... unless i'm missing something

--=20
Jaime Casanova=A0 =A0 =A0 =A0=A0 www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitaci=F3n

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6258: Lock Sequence
Следующее
От: "Stan S"
Дата:
Сообщение: BUG #6259: Collation Error with Citext fields