pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliveiros Cristina <oliveiros.cristina@marktest.pt>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Obtaining the primary key of the record just inserted
Date: Thu, 8 Nov 2007 19:10:41 -0000
Message-ID: <00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt> (raw)
References: <009901c82230$a799d3b0$ec5a3d0a@marktestcr.marktest.pt>
	<dcc563d10711081003o515df294mdbf2b3bde2fe6b85@mail.gmail.com>

It worked perfectly.
Thanks a million, Scott.

Best,
Oliveiros
----- Original Message ----- 
From: "Scott Marlowe" <scott.marlowe@gmail.com>
To: "Oliveiros Cristina" <oliveiros.cristina@marktest.pt>
Cc: <pgsql-sql@postgresql.org>
Sent: Thursday, November 08, 2007 6:03 PM
Subject: Re: [SQL] Obtaining the primary key of the record just inserted


> On Nov 8, 2007 11:56 AM, Oliveiros Cristina
> <oliveiros.cristina@marktest.pt> 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() ; ?
> 
> In 8.2 and up:
> 
> insert into table a (info) values ('abc') returning id;
>



view thread (3+ messages)

Message-ID: <00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt>
Permalink:  ../00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt/
Also on:    postgresql.org/message-id/00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt

 · 

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: oliveiros.cristina@marktest.pt, scott.marlowe@gmail.com
  Subject: Re: Obtaining the primary key of the record just inserted
  In-Reply-To: <00c501c8223b$0dde0c90$ec5a3d0a@marktestcr.marktest.pt>

* 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