Re: "RETURNING PRIMARY KEY" syntax extension - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: "RETURNING PRIMARY KEY" syntax extension
Date
Msg-id 539617D7.1020300@nasby.net
Whole thread Raw
In response to Re: "RETURNING PRIMARY KEY" syntax extension  (Hannu Krosing <hannu@2ndQuadrant.com>)
Responses Re: "RETURNING PRIMARY KEY" syntax extension  (Tom Dunstan <pgsql@tomd.cc>)
List pgsql-hackers
On 6/9/14, 8:35 AM, Hannu Krosing wrote:
> On 06/09/2014 06:58 AM, Ian Barwick wrote:
>> Hi,
>>
>> The JDBC API provides the getGeneratedKeys() method as a way of
>> retrieving
>> primary key values without the need to explicitly specify the primary key
>> column(s).
> Is it defined by the standard, to return _only_ generated primary keys,
> and not
> for example generated alternate keys ?

I was wondering that myself. I think it's certainly reasonable to expect someone would wan RETURNING SEQUENCE VALUES,
whichwould return the value of every column that owned a sequence (ie: ALTER SEQUENCE ... OWNED BY). ISTM that would
certainlyhandle the performance aspect of this, and it sounds more in line with what I'd expect getGeneratedKeys() to
do.
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Inaccuracy in VACUUM's tuple count estimates
Next
From: Jeff Janes
Date:
Subject: Re: Allowing NOT IN to use ANTI joins