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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>, pgsql-general(at)postgresql(dot)org
Subject: Re: Resetting a sequence's last value...
Date: 2003-04-27 20:52:16
Message-ID: 20030427205216.GA28917@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Apr 27, 2003 at 12:39:37 -0700,
Sean Chittenden <sean(at)chittenden(dot)org> wrote:
>
> Thoughts? I got a post offlist suggesting writing a C function, but
> that's pretty dependent on the backend and would have to be recompiled
> from version to version, something I'm not too wild about. -sc

What would seem logical to me is using the iscalled parameter to setval
to determine this. If you call setval('seq', 1, false), I think it
would be reasonable for the currval('seq') to be undefined until
nextval('seq') or setval with iscalled=true is called.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-27 20:54:03 Re: Resetting a sequence's last value...
Previous Message Sean Chittenden 2003-04-27 19:39:37 Re: Resetting a sequence's last value...