Skip site navigation (1) Skip section navigation (2)

Re: Obtaining the primary key of the record just inserted

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Oliveiros Cristina <oliveiros(dot)cristina(at)marktest(dot)pt>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Obtaining the primary key of the record just inserted
Date: 2007-11-08 18:01:48
Message-ID: 47334F0C.4090508@mail.nih.gov (view raw or flat)
Thread:
Lists: pgsql-novice
Oliveiros Cristina wrote:
> Hello, All,
>  
> I have the need to know the primary key assigned to a record I've just
> INSERTed .
>  
> Is there an easy way to solve this ?
>  
> Similar to SQLServer's  SELECT scope_identity() ; ?
>  
> Any help deeply appreciated
Is the primary key a SERIAL column?

Sean


In response to

pgsql-novice by date

Next:From: Hans-Peter OeriDate: 2007-11-08 19:24:49
Subject: Re: Obtaining the primary key of the record just inserted
Previous:From: Oliveiros CristinaDate: 2007-11-08 17:50:16
Subject: Obtaining the primary key of the record just inserted

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group