Re: Get the last inserted id - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: Get the last inserted id
Date
Msg-id 20080411175744.GA29043@crankycanuck.ca
Whole thread Raw
In response to Get the last inserted id  ("Nacef LABIDI" <nacef.l@gmail.com>)
List pgsql-sql
On Fri, Apr 11, 2008 at 07:23:04PM +0200, Nacef LABIDI wrote:
> Hi all,
> 
> I was wondering if postgres can return the last ID inserted for a table
> which the primary key is autoincremented. I need to retrieve this ID in my
> code to continue processing on that inserted row.

Use select currval() on the sequence name.

A


pgsql-sql by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Get the last inserted id
Next
From: Emi Lu
Date:
Subject: export CSV file through Java JDBC