LAST_INSERT_ID equivalent

From: Erik Price <eprice(at)ptc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: LAST_INSERT_ID equivalent
Date: 2003-06-12 17:14:59
Message-ID: 3EE8B513.2070804@ptc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with a SEQUENCE on it that increments the primary key (a
BIGINT column) of the table whenever a new insert is performed.

Is there a way to determine the last incremented value, so that if I do
an insert, I can record the primary key of the record somewhere? I'm
interested in any technique for doing this, but especially a
JDBC-specific solution.

Sorry if the answer should be obvious but I am coming from MySQL and
trying to learn the ANSI equivalent of the MySQL features.

Thanks,

Erik

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2003-06-12 17:18:27 Re: need a method to ping a running database
Previous Message Weiping He 2003-06-12 17:14:21 Re: Cast: timestamp to integer