Re: getting back autonumber just inserted - Mailing list pgsql-sql

From Alvaro Herrera
Subject Re: getting back autonumber just inserted
Date
Msg-id 20050707191510.GC11800@alvh.no-ip.org
Whole thread Raw
In response to Re: getting back autonumber just inserted  (mail TechEvolution <mail@techevolution.be>)
List pgsql-sql
On Thu, Jul 07, 2005 at 08:21:12PM +0200, mail TechEvolution wrote:
> hi Alvaro Herrera
> 
> >>You use the currval() function, using the name of the involved sequence
> >>as parameter.  There is a pg_get_serial_sequence() function, to which
> >>you give the table name and column name
> 
> thx for the information
> 
> and is there a function i can use to get the last added autonumber without 
> knowing wich table or row? (exactly as select @@ IDENTITY does?) i have 
> read in the messages that there must be such a function for version 8.0, 
> but i could not find it in the documentation, any idea on it?

There is no such function in 8.0.  There will be in 8.1, however.

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)


pgsql-sql by date:

Previous
From: mail TechEvolution
Date:
Subject: Re: getting back autonumber just inserted
Next
From: Theodore Petrosky
Date:
Subject: Re: getting back autonumber just inserted