Re: Support for grabbing multiple consecutive values with nextval()

Поиск
Список
Период
Сортировка
От Ronan Dunklau
Тема Re: Support for grabbing multiple consecutive values with nextval()
Дата
Msg-id 2516352.Lt9SDvczpP@aivenronan
обсуждение исходный текст
Ответ на Re: Support for grabbing multiple consecutive values with nextval()  (Jille Timmermans <jille@quis.cx>)
Список pgsql-hackers
Hello,

Reading the thread, I think the feature has value: it would basically transfer 
control of the sequence cache to the client application.

However, I don't think that returning only the last value is a sensible thing 
to do. The client will need to know the details of the sequence to do anything 
useful about this, especially it's increment, minvalue, maxvalue and cycle 
options. 

As suggested upthread, returning a resultset would probably be better. If the 
client application is concerned about the volume of data exchanged with the 
server, and is willing to deal with handling the knowledge of the sequence 
details themselves, they can always wrap it in an aggregate:

SELECT min(newvals), max(newvals)   FROM nextvals(<num_nextvals>) as newvals

Regards,

--
Ronan Dunklau





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

Предыдущее
От: Ian Lawrence Barwick
Дата:
Сообщение: Re: Support TRUNCATE triggers on foreign tables
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns