How to get the value in the lastvalue field

From: "Venki" <Venki(at)insoft(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to get the value in the lastvalue field
Date: 2005-10-26 12:23:04
Message-ID: 435F7528.000005.02700@VENKI
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Thanks in advance
Kind Regards,
Venki

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-10-26 12:34:53 Re: How to get the value in the lastvalue field
Previous Message Alban Hertroys 2005-10-26 12:01:01 Re: function DECODE and triggers