pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: mail TechEvolution <mail@techevolution.be>
Cc: pgsql-sql@postgresql.org
Subject: Re: getting back autonumber just inserted
Date: Thu, 7 Jul 2005 15:15:10 -0400
Message-ID: <20050707191510.GC11800@alvh.no-ip.org> (raw)
In-Reply-To: <42CD7298.7040504@techevolution.be>
References: <42CD6B58.6060508@techevolution.be>
	<20050707180329.GA11332@alvh.no-ip.org>
	<42CD7298.7040504@techevolution.be>

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)



view thread (30+ messages)  latest in thread

Message-ID: <20050707191510.GC11800@alvh.no-ip.org>
Permalink:  ../20050707191510.GC11800@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20050707191510.GC11800@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@alvh.no-ip.org, mail@techevolution.be
  Subject: Re: getting back autonumber just inserted
  In-Reply-To: <20050707191510.GC11800@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox