Insert and obtain the pk

From: "Eliu Montoya" <eliu(at)itam(dot)mx>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Insert and obtain the pk
Date: 2003-11-06 18:26:48
Message-ID: 200311061816.hA6IGqS22254@cc107.itam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everybody,

Does anyone know an easy way to insert a record (without a value for the
primary key because it is a sequence) and at the same time obtain the value
of primary key that was assign to this new record.

I always try insert and then select with the same values that I used for the
insert, but I believe this is not a good way to do it.

Any suggestions???

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Stiefel 2003-11-06 18:29:08 Re: Question on database structure
Previous Message Carlos Oliva 2003-11-06 18:19:44 Re: Install files for version 7.4