Re: Getting consecutive sequence values

From: Dave Smith <dave(dot)smith(at)candata(dot)com>
To: nolan(at)celery(dot)tssi(dot)com
Cc: pgsql list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Getting consecutive sequence values
Date: 2003-04-04 19:24:20
Message-ID: 3E8DDBE4.9060807@candata.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

try

select setval('id',nextval('id')+100)

nolan(at)celery(dot)tssi(dot)com wrote:

>(The first copy of this got stalled because of internal addressing issues,
>hopefully it will not be duplicated.)
>
>I'm using a sequence to generate unique 8 digit record keys which will be
>given out as membership ID's.
>
>Because we want to be able to pre-assign blocks of membership numbers
>for use in off-line membership registration situations, I need to be able
>to ensure that a block of sequences are in consecutive order even though
>they may be requested concurrently with other activity on the sequence.
>
>If I use SQL such as "select nextval('id'),nextval('id'),...,nextval('id')"
>to allocate 50 or 100 sequence numbers, will the backend ensure that
>those sequence numbers are a consecutive block?
>--
>Mike Nolan
>nolan(at)tssi(dot)com
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-04-04 19:31:04 Re: Getting consecutive sequence values
Previous Message nolan 2003-04-04 19:00:05 Getting consecutive sequence values