Re: [HACKERS] Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Hiroshi Inoue [EMAIL PROTECTED] writes: Hmm OIDs would be optional in 7.2. Is it known(announced) to pgsql-jdbc list ? Doesn't seem particularly relevant to this issue though. An application that's using OIDs to identify rows would certainly not choose to create its tables without OIDs. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [HACKERS] Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
On Thu, 23 Aug 2001 14:44:19 -0400, you wrote: Ned Wolpert [EMAIL PROTECTED] writes: Should the backend support the function getLastInsertedOID()? 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. What should the semantics be exactly? How about the multiple INSERT's i've been reading about on hackers? ... Only the OID of the last row inserted by the statement? How about an UPDATE statement that updates multiple rows? How about JDBC batchExecute() when it performs multiple INSERT/UPDATE's? ... Only the OID of the last UPDATE or INSERT statement in the batch? How about triggers that insert/update extra rows? ... Only the OID of the row directly inserted by the client statement? How about Large Objects? Should inserting or updating a large object affect getLastInsertedOID()? I assume this OID would be associated with a client connection. Is this going to work with client side connection pooling? How about transaction semantics? INSERT row 1, Commit, INSERT row 2, Rollback... what should getLastInsertedOID() return? Can it, with a static variable? Regards, René Pijlman ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
Re: [HACKERS] Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Rene Pijlman [EMAIL PROTECTED] writes: On Thu, 23 Aug 2001 14:44:19 -0400, you wrote: 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. What should the semantics be exactly? Just the same as the command result string. How about the multiple INSERT's i've been reading about on hackers? ... Only the OID of the last row inserted by the statement? No OID is returned when multiple rows are inserted or updated. I'd say that should be the semantics of this function, too. How about JDBC batchExecute() when it performs multiple INSERT/UPDATE's? By definition, this is a backend function. It cannot know anything of JDBC. I assume this OID would be associated with a client connection. Is this going to work with client side connection pooling? Good point. Will this really get around the original poster's problem?? regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[HACKERS] Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Ned Wolpert [EMAIL PROTECTED] 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 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [HACKERS] Re: [JDBC] New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Tom Lane wrote: Ned Wolpert [EMAIL PROTECTED] 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 Hmm OIDs would be optional in 7.2. Is it known(announced) to pgsql-jdbc list ? regards, Hiroshi Inoue ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]