Re: [GENERAL] getting the currval of a sequence - Mailing list pgsql-general

From Vadim Mikheev
Subject Re: [GENERAL] getting the currval of a sequence
Date
Msg-id 35D3EC51.64768A3A@krs.ru
Whole thread Raw
In response to Re: [GENERAL] getting the currval of a sequence  (dustin sallings <dustin@spy.net>)
List pgsql-general
dustin sallings wrote:
>
> On Fri, 14 Aug 1998, Fran Fabrizio wrote:
>
>         If you've recently done an insert and want to know what the value
> was, you can do this:
>
>         select last_value from mysequence;

NO! This is wrong!

Use currval('_seq_name_') !!!

>
> //
> // Hi all,
> //
> // I need to do the equivalent of:
> //
> //  select my_sequence.CURRVAL from Sys.dual;
> //
> // so I'm guessing its:
> //
> //  select currvar('my_sequence') from ???????;
> //
> // Can anyone fill in the ????  Thanks!
> //

Vadim

pgsql-general by date:

Previous
From: dustin sallings
Date:
Subject: Re: [GENERAL] getting the currval of a sequence
Next
From: Frank Bringezu
Date:
Subject: Problem: Permission denied when accessing a database via www