Re: Generating Lots of PKs with nextval(): A Feature Proposal - Mailing list pgsql-hackers

From hubert depesz lubaczewski
Subject Re: Generating Lots of PKs with nextval(): A Feature Proposal
Date
Msg-id 20100514210405.GA11826@depesz.com
Whole thread Raw
In response to Re: Generating Lots of PKs with nextval(): A Feature Proposal  (Kenneth Marshall <ktm@rice.edu>)
Responses Re: Generating Lots of PKs with nextval(): A Feature Proposal
List pgsql-hackers
On Fri, May 14, 2010 at 02:07:27PM -0500, Kenneth Marshall wrote:
> Hi Peter,
> 
> All you need to do is define your own sequence with an
> increment of 500. Look at:
> 
> http://www.postgresql.org/docs/8.4/static/sql-createsequence.html

This is often not enough. For example - I want standard increment of 1,
but right now I'm importing 10000 objects, and it would be simpler for
me to get 10000 ids. Preferably in one block.

This is not achievable now. I know I can 'alter sequence set increment
by' - but this will also affect concurrent sessions. which might not be
a problem, but it's a side effect that I don't want.

+1 for original proposition, would love to get it.

depesz


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle
Next
From: "Kevin Grittner"
Date:
Subject: Re: List traffic