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

From Ian Barwick
Subject Re: "RETURNING PRIMARY KEY" syntax extension
Date
Msg-id 53955168.9060300@2ndquadrant.com
Whole thread Raw
In response to Re: "RETURNING PRIMARY KEY" syntax extension  (David G Johnston <david.g.johnston@gmail.com>)
Responses Re: "RETURNING PRIMARY KEY" syntax extension  (David Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers

On 09/06/14 14:47, David G Johnston wrote:
> 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). This is a widely-used feature, however the implementation has
>> significant
>> performance drawbacks.
>>
>> Currently this feature is implemented in the JDBC driver by appending
>> "RETURNING *" to the supplied statement. However this means all columns of
>> affected rows will be returned to the client, which causes significant
>> performance problems, particularly on wide tables. To mitigate this, it
>> would
>> be desirable to enable the JDBC driver to request only the primary key
>> value(s).
>
> Seems like a good idea.
>
>
>>       ERROR:  Relation does not have any primary key(s)
>
> "Relation does not have a primary key."
> or
> "Relation has no primary key." (preferred)
>
> By definition it cannot have more than one so it must have none.

Ah yes, amazing what a fresh pair of eyes does :). The plural is
the vestige of an earlier iteration which said something about
the relation not having any primary key column(s).

Will fix, thanks.

Regards

Ian Barwick


--  Ian Barwick                   http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: "RETURNING PRIMARY KEY" syntax extension
Next
From: Amit Kapila
Date:
Subject: Re: Inaccuracy in VACUUM's tuple count estimates