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

Поиск
Список
Период
Сортировка
От Jorge Godoy
Тема Re: Best approach for a "gap-less" sequence
Дата
Msg-id 87wt9ctyms.fsf@ieee.org
обсуждение исходный текст
Ответ на Re: Best approach for a "gap-less" sequence  (Christian Kratzer <ck-lists@cksoft.de>)
Ответы Re: Best approach for a "gap-less" sequence  (Christian Kratzer <ck-lists@cksoft.de>)
Список pgsql-general
Christian Kratzer <ck-lists@cksoft.de> writes:

> I would at least try to assign multiple such numbers in batches to mimize
> contention on the row you store the counter in.

What do you mean here?  How would you guarantee that on of the receiver
transactions didn't rollback and left a gap in the "sequence"?

I believe that for invoices it is less problematic.  At least here I don't
need the "time" part control, so if I leave one blank I can fill it later in
the same day without problems (except, of course, if the sequence number is
tied to some other physical evidence such as the paper counterpart of the
invoice and that is also chronologically assigned).

The whole problem appears because no matter how much we validate input and
relationships on the input interface, something might happen and make the
"INSERT" transaction fail.  Theoretically, all should go fine, but... :-)

--
Jorge Godoy      <jgodoy@gmail.com>


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

Предыдущее
От: Christian Kratzer
Дата:
Сообщение: Re: Best approach for a "gap-less" sequence
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Connection string