How to get the value in the lastvalue field - Mailing list pgsql-general

From Venki
Subject How to get the value in the lastvalue field
Date
Msg-id 435F7528.000005.02700@VENKI
Whole thread Raw
Responses Re: How to get the value in the lastvalue field
Re: How to get the value in the lastvalue field
List 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

 

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: function DECODE and triggers
Next
From: Sean Davis
Date:
Subject: Re: How to get the value in the lastvalue field