Re: Obtaining the primary key of the record just inserted

From: Hans-Peter Oeri <hp(at)oeri(dot)ch>
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 19:24:49
Message-ID: 47336281.1040906@oeri.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi!

Oliveiros Cristina wrote:
> 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 ?
I prefer:
INSERT INTO [...] RETURNING id;

HPO

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Monarchi 2007-11-09 00:13:28 Constructing two-dimensional arrays from a query
Previous Message Sean Davis 2007-11-08 18:01:48 Re: Obtaining the primary key of the record just inserted