Re: Support for grabbing multiple consecutive values with nextval() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Support for grabbing multiple consecutive values with nextval()
Date
Msg-id 3437952.1659026830@sss.pgh.pa.us
Whole thread Raw
In response to Re: Support for grabbing multiple consecutive values with nextval()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Support for grabbing multiple consecutive values with nextval()
List pgsql-hackers
I wrote:
> I've got no strong opinion about this bit:
>> As suggested upthread, returning a resultset would probably be better.

Actually, on further thought, I do like the resultset idea, because
it'd remove the need for a complex rewrite of nextval_internal.
Assuming the SRF is written in ValuePerCall style, each iteration
can just call nextval_internal with no modifications needed in that
function.  There'll be a CHECK_FOR_INTERRUPTS somewhere in the
query-level loop, or at least it's not nextval's fault if there's not.
The situation is then no different from generate_series with a large
loop count, or any other query that can generate lots of data.

Of course, this does imply a lot more cycles expended per generated value
--- but most of that is inherent in the larger amount of data being
handed back.

            regards, tom lane



pgsql-hackers by date:

Previous
From: tushar
Date:
Subject: Re: replacing role-level NOINHERIT with a grant-level option
Next
From: Robert Haas
Date:
Subject: Re: making relfilenodes 56 bits