Re: Using oids - Mailing list pgsql-general

From Doug McNaught
Subject Re: Using oids
Date
Msg-id m3ekyx7t2b.fsf@varsoon.wireboard.com
Whole thread Raw
In response to Re: Using oids  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List pgsql-general
Dennis Gearon <gearond@fireserve.net> writes:

> Oliver Elphick wrote:
>
> >You cannot use currval() until you have used nextval() on the same
> >sequence in the same session.

> Why is that, anyway, and why should it be?

Because that's what currval() does.  It doesn't have anything to do
with sequence values in other sessions.  It gives you the last value
*you* got for thee sequence, so if you haven't called nextval() yet
you should and do get an error.

Maybe it should have been called lastval(), but that could be a bit
misleading too...

-Doug

pgsql-general by date:

Previous
From: psql-mail@freeuk.com
Date:
Subject: postmaster crashing
Next
From: Tom Lane
Date:
Subject: Re: pg_dump incorrect sequence value