Search Postgresql Archives

Re: How to get the value in the lastvalue field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/26/05 8:23 AM, "Venki" <Venki@xxxxxxxxxx> 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


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux