Re: New backend functions? [was Re: JDBC changes for 7.2... some questions...] - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Date
Msg-id 6337.998592259@sss.pgh.pa.us
Whole thread Raw
In response to New backend functions? [was Re: JDBC changes for 7.2... some questions...]  (Ned Wolpert <ned.wolpert@knowledgenet.com>)
Responses Re: New backend functions? [was Re: JDBC changes for 7.2.
Re: [HACKERS] Re: New backend functions? [was Re: JDBC changes for 7.2... some questions...]
List pgsql-jdbc
Ned Wolpert <ned.wolpert@knowledgenet.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

pgsql-jdbc by date:

Previous
From: Ned Wolpert
Date:
Subject: New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Next
From: Rene Pijlman
Date:
Subject: Re: Re: Couple of patches for jdbc driver