Re: getting back autonumber just inserted

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: mail TechEvolution <mail(at)techevolution(dot)be>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: getting back autonumber just inserted
Date: 2005-07-07 19:15:10
Message-ID: 20050707191510.GC11800@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Theodore Petrosky 2005-07-07 20:14:33 Re: getting back autonumber just inserted
Previous Message mail TechEvolution 2005-07-07 18:21:12 Re: getting back autonumber just inserted