Re: Get block of N numbers from sequence

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Get block of N numbers from sequence
Дата
Msg-id 20090519155746.GB17055@depesz.com
обсуждение исходный текст
Ответ на Re: Get block of N numbers from sequence  (Thomas Guettler <hv@tbz-pariv.de>)
Список pgsql-general
On Tue, May 19, 2009 at 03:32:16PM +0200, Thomas Guettler wrote:
> If other processes run nextval() between "increment by 1000" and "increment by 1",
> they leave big holes in the sequence.

yes. I know. there is no other way.

if you want 1000 ids, but they don't have to be consequtive, you can
simply:
select nextval('qq') from generate_series(1,1000);

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: INTERVAL data type and libpq - what format?
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: array/function question