Re: Best approach for a "gap-less" sequence

Поиск
Список
Период
Сортировка
От Jorge Godoy
Тема Re: Best approach for a "gap-less" sequence
Дата
Msg-id 87d5azilmz.fsf@gmail.com
обсуждение исходный текст
Ответ на Re: Best approach for a "gap-less" sequence  (elein <elein@varlena.com>)
Список pgsql-general
elein <elein@varlena.com> writes:

> If this is true the solution for a transactional, gapless sequence is possible
> for table.gl_id  where updated from count.gl_id.  It is simple.  However, it
> *depends* on the fact that the second transaction getting the newly updated
> record from the first transaction.  It seems pretty clear, not counting aggregates,
> that this is true from this doc snippet.  Speak now, if someone doesn't read it
> this way!  I'd like to understand why.

I agre with your reading.

> If it weren't true, there would also be a workaround which caught a duplicate
> value and tried again, looping.

This is true, but really bad.  I believe a friend of mine had something like
that in another database server, but it really looked like an ugly hack...  Of
course, if it's the only way to solve the problem then we have to live with
it.

> I may publish the gapless sequence technique on general bits if there is no
> discrepancy in the understanding of the status of the second transaction's
> row value (updated).

I need more testing here.  But from what I tested, your reading looks right.


--
Jorge Godoy      <jgodoy@gmail.com>

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

Предыдущее
От: Jorge Godoy
Дата:
Сообщение: Re: Best approach for a "gap-less" sequence
Следующее
От: Jorge Godoy
Дата:
Сообщение: Re: Best approach for a "gap-less" sequence