Re: Getting consecutive sequence values - Mailing list pgsql-general

From Dennis Gearon
Subject Re: Getting consecutive sequence values
Date
Msg-id 3E8DDD78.8020506@cvc.net
Whole thread Raw
In response to Getting consecutive sequence values  (nolan@celery.tssi.com)
List pgsql-general
you might try multiple sequences started with different values.

seq_from800
seq_from900,

etc.

A better way would be to use an intermediate table with the sequence showing
which values have been used. Not clearly thought out in my head though.

nolan@celery.tssi.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@tssi.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


pgsql-general by date:

Previous
From: Dave Smith
Date:
Subject: Re: Getting consecutive sequence values
Next
From: Lonni J Friedman
Date:
Subject: Re: unable to dump database, toast errors