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

Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com>
Cc: Barry Lind <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Date: 2001-08-23 18:44:19
Message-ID: 6337.998592259@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-jdbc
Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com> writes:
> Should the backend support the function getLastInsertedOID() or even
> getLastInsertedPrimaryKey() (or both)?

I don't think you have any chance of doing the latter --- for one thing,
how are you going to declare that function's return type?  But the
former seems doable and reasonable to me: whenever an OID is returned
to the client in an INSERT or UPDATE command result, also stash it in
a static variable that can be picked up by this function.

Please pick a more SQL-friendly (ie, case insensitive) naming
convention, though.  And note that it'd apply to both INSERT and UPDATE.
Maybe get_last_returned_oid() ?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-08-23 19:00:46
Subject: Re: A couple items on TODO
Previous:From: Christopher MastoDate: 2001-08-23 18:09:24
Subject: Re: Escaping strings for inclusion into SQL queries

pgsql-jdbc by date

Next:From: Rene PijlmanDate: 2001-08-23 19:14:22
Subject: Re: Re: Accessing multiple Databases at the same time
Previous:From: Robert B. EasterDate: 2001-08-23 18:37:27
Subject: JDBC patch for util.Serialize and jdbc2.PreparedStatement

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