On Thu, 24 Jul 2003 greg@turnstep.com wrote:
> > The main problem with this approach is that, while you get the "current
> > value", the sequence is incremented by the call. I just want to
> > (strictly) look at the value.
>
> The sequence values do not change: test it for yourself.
I'm not sure, but if another transaction wanted to do a nextval at "the
same time" couldn't the sequence of events end up going something like:
T1: nextval
T2: nextval
T1: setval(currval-1)
which would do the wrong thing since the next nextval would give the same
value that T2 already got?