Re: lastval(seq) ? - Mailing list pgsql-general

From Richard Huxton
Subject Re: lastval(seq) ?
Date
Msg-id 200310211406.50334.dev@archonet.com
Whole thread Raw
In response to Re: lastval(seq) ?  (Jeff <threshar@torgo.978.org>)
List pgsql-general
On Tuesday 21 October 2003 13:10, Jeff wrote:
> On Mon, 20 Oct 2003 21:52:17 -0700 (PDT)
>
> CSN <cool_screen_name90001@yahoo.com> wrote:
> > How do you get the last value of a sequence without
> > having called nextval? phppgadmin displays last value
> > for sequences (I haven't found out how yet rooting
> > through the code).
> >
> > CSN
>
> select curval('my_sequence')

Only works if you've called nextval() first.

I'm guessing phppgadmin uses SELECT * FROM my_seq_name

What were you planning to use this value for?

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Diogo Biazus
Date:
Subject: About TSearch2 Performance
Next
From: Andrew Sullivan
Date:
Subject: Re: Recomended FS