Skip site navigation (1) Skip section navigation (2)

sequence value of the record just inserted.

From: Ben Kim <bkim(at)coe(dot)tamu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: sequence value of the record just inserted.
Date: 2004-04-09 14:59:04
Message-ID: Pine.GSO.4.10.10404090954300.10715-100000@edsun.coe.tamu.edu (view raw or flat)
Thread:
Lists: pgsql-admin
Dear admins,

I have a table whose primary key is a record_id with serial type. 

I would like to know, when I insert a new row, what was the value of the
record_id that I just inserted. Since this is a multi user application, I
cannot simply select max of the record_id or currval of the sequence.

I would appreciate an advice.

Regards,
Ben Kim


Responses

pgsql-admin by date

Next:From: scott.marloweDate: 2004-04-09 15:10:17
Subject: Re: Multiple disks
Previous:From: Tom LaneDate: 2004-04-09 12:51:06
Subject: Re: Trouble restoring 7.2.1 database into 7.4.2 database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group