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

From Tom Lane
Subject Re: Getting consecutive sequence values
Date
Msg-id 10107.1049496026@sss.pgh.pa.us
Whole thread Raw
In response to Re: Getting consecutive sequence values  (Dave Smith <dave.smith@candata.com>)
List pgsql-general
Dave Smith <dave.smith@candata.com> writes:
> I'm assuming that the setval would create an exclusive lock on the
> sequence until it is complete. Tom/Bruce?

But the setval() doesn't start to execute until some time after the
nextval() completes.  The window during which you're executing the
addition of 100 would easily allow some other process to perform a
nextval().  Mike's right, this doesn't work.

            regards, tom lane


pgsql-general by date:

Previous
From: nolan@celery.tssi.com
Date:
Subject: Re: dbmirror revisions
Next
From: nolan@celery.tssi.com
Date:
Subject: Re: Getting consecutive sequence values