Re: Generating Lots of PKs with nextval(): A Feature Proposal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Crabtree <peter(dot)crabtree(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Generating Lots of PKs with nextval(): A Feature Proposal
Date: 2010-05-14 21:27:01
Message-ID: 10932.1273872421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Crabtree <peter(dot)crabtree(at)gmail(dot)com> writes:
> Now, I was reminded that I could simply do this:

> SELECT nextval('my_seq') FROM generate_series(1, 500);

> But of course then I would have no guarantee that I would get a
> contiguous block of ids,

The existing "cache" behavior will already handle that for you,
I believe. I don't really see a need for new features here.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-05-14 21:29:35 Re: Generating Lots of PKs with nextval(): A Feature Proposal
Previous Message Tom Lane 2010-05-14 21:23:18 Re: recovery consistent != hot standby