Dave Smith <dave(dot)smith(at)candata(dot)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