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

Obtaining the primary key of the record just inserted

From: "Oliveiros Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Obtaining the primary key of the record just inserted
Date: 2007-11-08 17:50:16
Message-ID: 007d01c8222f$d25a26f0$ec5a3d0a@marktestcr.marktest.pt (view raw or flat)
Thread:
Lists: pgsql-novice
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

Best,
Oliveiros

Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2007-11-08 18:01:48
Subject: Re: Obtaining the primary key of the record just inserted
Previous:From: Nico CallewaertDate: 2007-11-08 15:35:38
Subject: Re: Trigger function syntax

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