Received: from charon.simplot.com (jrsmailhub.simplot.com [12.18.144.212]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAFJ5Lm27158 for ; Thu, 15 Nov 2001 14:05:21 -0500 (EST) (envelope-from earlj@xanadu.simplot.com) Received: from xanadu.simplot.COM (151.113.0.132) by charon.simplot.com (MX V5.1-A AnGp) with SMTP; Thu, 15 Nov 2001 12:05:20 -0700 Received: from npa01zz001.simplot.com by xanadu.simplot.COM; (5.65v4.0/1.1.8.2/20Aug97-1116AM) id AA27314; Thu, 15 Nov 2001 12:05:20 -0700 Received: from earlj by npa01zz001.simplot.com with local (Exim 3.32 #1 (Debian)) id 164Rp9-0002bF-00; Thu, 15 Nov 2001 12:05:19 -0700 To: "Bryan White" CC: "pgsql-sql" Subject: Re: How to best grab a chunk of Ids from a sequence References: <00a801c16df3$e06d6230$2ed260d1@bryan> From: Jason Earl Date: 15 Nov 2001 12:05:19 -0700 In-Reply-To: <00a801c16df3$e06d6230$2ed260d1@bryan> Message-ID: <873d3fvor4.fsf@npa01zz001.simplot.com> Lines: 31 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200111/223 X-Sequence-Number: 5606 What you could do is use the setval() function to set the value of the sequence to whatever it is now + 4 million. That would give you a great big hole in your sequence from which you could draw sequence values from. Your processes that still needed to use the sequence would still be able to, and the information that you are importing could use the sequence numbers that you skipped. Jason "Bryan White" writes: > I have a process that will be creating a large number of records (about > 4Million). I am thinking of making this process run quicker by writing the > records to a file in 'dump' format and then running that file through psql. > > The problem is each record has a sequence number and I need to know the > sequence ids for other > purposes in this process. > > My question is is there a way to grab 4 million IDs from a sequence without > calling nextval once for each ID. Note, this sequence is being actively > drawn on by other processes. > > --------- > Bryan White > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org