Re: How to get the value in the lastvalue field

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Venki <Venki(at)insoft(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get the value in the lastvalue field
Date: 2005-10-26 12:34:53
Message-ID: BF84F02D.11C8F%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/26/05 8:23 AM, "Venki" <Venki(at)insoft(dot)com> wrote:

>
> Hi,
> Can anyone in the list tell me how to get the value in the lastvalue field of
> a sequence. I tried
> select currval('field_seq');
>
> but got an error message
>
> ERROR: currval of sequence "field_seq" is not yet defined in this session.
>
> I think currval will work only after an insert. I don't want to use nextval as
> this increases the lastvalue value.

That is correct. You can't call currval until you have called nextval
first. Why do you want to know? That might help answer the question.

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2005-10-26 12:35:01 Re: How to get the value in the lastvalue field
Previous Message Venki 2005-10-26 12:23:04 How to get the value in the lastvalue field