Return key from query - Mailing list pgsql-general

From Jonathan Tripathy
Subject Return key from query
Date
Msg-id 4CD07804.2010901@abpni.co.uk
Whole thread Raw
Responses Re: Return key from query  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: Return key from query  (Szymon Guz <mabewlun@gmail.com>)
Re: Return key from query  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
Hi everyone,

When adding a new record, we run an insert query which auto-increments
the primary key for the table. However the method (in java) which calls
this query must return the newly created key.

Any ideas on how to do this, preferably using a single transaction?

Thanks

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade segfault (was: pg_migrator segfault)
Next
From: Steve Crawford
Date:
Subject: Re: Return key from query