How to best grab a chunk of Ids from a sequence

From: "Bryan White" <bryan(at)arcamax(dot)com>
To: "pgsql-sql" <pgsql-sql(at)postgreSQL(dot)org>
Subject: How to best grab a chunk of Ids from a sequence
Date: 2001-11-15 16:37:55
Message-ID: 00a801c16df3$e06d6230$2ed260d1@bryan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Roland Roberts 2001-11-15 16:44:44 Re: Help with INSERT into 2 tables
Previous Message Roland Roberts 2001-11-15 16:26:41 Re: problem: index on number not honoured