I've not actually looked in the source but i presume that insert returning would work internally similar to a select in an update_after or insert_after trigger. If so then it should not care that an entry is a sequence or otherwise, it should care what the actual data in the table is. It must work on the actual data to properly work with defaults that are a product of a function that is not a serial. Eg a uniqueidentifier's newid() func.

I could be wrong. But insert returning without picking up column defaults would be extremely useless. getAutoGeneratedKeys in jdbc seems like it would be a very useful interface, so if this patch doesnt support implementing this, someone should fix that. (I'd check/fix it myself, but i don't have much of a clue when it comes to c programming)

Kevin McArthur
----- Original Message ----- From: "Dave Cramer" <[EMAIL PROTECTED]>
To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "Neil Conway" <[EMAIL PROTECTED]>; "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Sent: Monday, October 17, 2005 6:12 AM
Subject: Re: [HACKERS] PostgreSQL roadmap for 8.2 and beyond.


I fail to see how this solves the problem of getting auto generated  keys.

AFAIKS, the protocol needs to be tweaked to return at a minimum the currval for the first serial in the row, but more correctly all of the modified currval's for an insert

if we had that then we could correctly implement getAutoGeneratedKeys for jdbc.

Dave
On 17-Oct-05, at 8:33 AM, Bruce Momjian wrote:

Neil Conway wrote:

On Sun, 2005-16-10 at 01:20 -0700, Kevin McArthur wrote:

Don't forget insert/update returning.


Omar Kilani has a patch for this:

http://archives.postgresql.org/pgsql-patches/2005-07/msg00568.php

I would like to see it get into 8.2


Yes, this is in the 8.2 patches queue:

    http://momjian.postgresql.org/cgi-bin/pgpatches_hold


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of  broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org




---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq



---------------------------(end of broadcast)---------------------------
TIP 1: 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

Reply via email to