Re: Increment a sequence by more than one

Поиск
Список
Период
Сортировка
От Peter Childs
Тема Re: Increment a sequence by more than one
Дата
Msg-id a2de01dd0708060000k504525bdt99177726bb7af529@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Increment a sequence by more than one  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-sql


On 03/08/07, Michael Glaesemann <grzm@seespotcode.net> wrote:

On Aug 3, 2007, at 15:27 , Erik Jones wrote:

> Is there actually a requirement that the block of 5000 values not
> have gaps?

Good point.

> If not, why not make the versioned table's id column default to
> nextval from the same sequence?

Of course, the ids of the two tables could be interleaved in this
case. This might not be an issue, of course.


Michael Glaesemann
grzm seespotcode net


It seams to me that one should use the cache feature of a sequence is there just for this purpose.

That way when you get the next value your session caches and any other sessions will get one after your cache range.

Peter

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] could not [extend relation|write block N of temporary file|write to hash-join temporary file]
Следующее
От: Steve Midgley
Дата:
Сообщение: Re: Increment a sequence by more than one