Re: How to create "auto-increment" field WITHOUT a sequence object?

Поиск
Список
Период
Сортировка
От A.M.
Тема Re: How to create "auto-increment" field WITHOUT a sequence object?
Дата
Msg-id CC059AA0-B030-46F6-8A70-E9B7B7C99FAB@themactionfaction.com
обсуждение исходный текст
Ответ на How to create "auto-increment" field WITHOUT a sequence object?  (Dmitry Koterov <dmitry@koterov.ru>)
Ответы Re: How to create "auto-increment" field WITHOUT a sequence object?  (Dmitry Koterov <dmitry@koterov.ru>)
Список pgsql-general
On Jun 30, 2011, at 2:40 PM, Dmitry Koterov wrote:

> Hello.
>
> I need to create an auto-increment field on a table WITHOUT using sequences:

This problem pops up a lot for invoice sequence numbers for the tax office and related cases. (Search for "gapless
sequence".) 

Since the numbers are really only needed for an external system (as you mention), then it may make sense to generate
thegapless IDs when necessary and map the generated IDs to the rows later. The drawback is that some rows in the table
willnot have the gapless ID until the batch job is run, but all rows will still be addressable by the real sequence ID. 

Cheers,
M



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

Предыдущее
От: salah jubeh
Дата:
Сообщение: Re: How to create "auto-increment" field WITHOUT a sequence object?
Следующее
От: Dmitry Koterov
Дата:
Сообщение: Re: How to create "auto-increment" field WITHOUT a sequence object?