Re: [GENERAL] getting the currval of a sequence

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: dustin sallings <dustin(at)spy(dot)net>
Cc: Fran Fabrizio <fran(at)primary(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] getting the currval of a sequence
Date: 1998-08-14 07:50:41
Message-ID: 35D3EC51.64768A3A@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank Bringezu 1998-08-14 09:03:51 Problem: Permission denied when accessing a database via www
Previous Message dustin sallings 1998-08-14 06:09:31 Re: [GENERAL] getting the currval of a sequence