Re: [GENERAL] returning oid of last insert?

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Matt McClure <matthew(dot)mcclure(at)yale(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] returning oid of last insert?
Date: 1998-07-19 09:17:02
Message-ID: Pine.LNX.3.96.980719101356.3339F-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 18 Jul 1998, Matt McClure wrote:

> Is there a way to return the oid of the last insert command?

The protocol does return the oid, as a string. You can see this when using
psql. I'm not sure what libpq function returns this value though.

In JDBC, there isn't an official way, but the 6.4 driver does have a
method to retrieve the oid (It's used internally with the new object
serialization code). Earler versions store the string, but don't use it,
and have no method to retrieve it.

--
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Konstantinos Vassiliadis 1998-07-19 12:26:36 Replaced Makefile in source directory (fwd)
Previous Message The Hermit Hacker 1998-07-19 03:00:29 Weekly Posting: Mini-FAQ (Last Modified: Jun 7, 98)