Support for grabbing multiple consecutive values with nextval()

Поиск
Список
Период
Сортировка
От Jille Timmermans
Тема Support for grabbing multiple consecutive values with nextval()
Дата
Msg-id 66d4a4ca840b1f84cc09aaefb20af788@quis.cx
обсуждение исходный текст
Ответы Re: Support for grabbing multiple consecutive values with nextval()  (Julien Rouhaud <rjuju123@gmail.com>)
Re: Support for grabbing multiple consecutive values with nextval()  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Re: Support for grabbing multiple consecutive values with nextval()  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
Hi,

First time PostgreSQL contributor here :)

I wanted to be able to allocate a bunch of numbers from a sequence at 
once. Multiple people seem to be struggling with this 
(https://stackoverflow.com/questions/896274/select-multiple-ids-from-a-postgresql-sequence, 
https://www.depesz.com/2008/03/20/getting-multiple-values-from-sequences/).

I propose to add an extra argument to nextval() that specifies how many 
numbers you want to allocate (default 1).

The attached patch (based on master) passes `./configure 
--enable-cassert --enable-debug && make && make check`, including the 
newly added regression tests.

It does change the signature of nextval_internal(), not sure if that's 
considered backwards compatibility breaking (for extensions?).

-- Jille
Вложения

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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Checkpointer sync queue fills up / loops around pg_usleep() are bad
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?