Re: Resetting a sequence's last value...

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Resetting a sequence's last value...
Date: 2003-04-27 08:21:26
Message-ID: 20030427082126.GL35599@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > I have a database application that makes extensive use of
> > currval(), but after a certain point in the transaction, I'd like
> > to reset the state of a given sequence so that the backend will
> > act as if the sequence hasn't been called. Something like
> > resetval() or the like is what I'm looking for, but it doesn't
> > exist as far as I can tell. Other than reconnecting to the
> > backend, are there other programmatic alternatives? -sc
>
> Umm.. setval doesn't work?
>
> file:/usr/local/doc/postgresql/html/functions-sequence.html is where I looked
> at my local 7.3.2 installation..

That won't work because it'll return the last value. In this case,
I'm looking to have things return an error if someone calls currval()
on the sequence. -sc

--
Sean Chittenden

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2003-04-27 13:59:10 Re: Schemas permissions vs \dt
Previous Message Shridhar Daithankar 2003-04-27 08:07:47 Re: Resetting a sequence's last value...