Re: Proposal: RETURNING primary_key() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: RETURNING primary_key()
Date
Msg-id 9482.1457410735@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: RETURNING primary_key()  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Proposal: RETURNING primary_key()
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> On 8 March 2016 at 08:56, Igal @ Lucee.org <igal@lucee.org> wrote:
>> I'm not sure why it was not accepted at the end?

> The biggest issue, though it might not be clear from that thread, is that
> what exactly it means to "return generated keys" is poorly defined by JDBC,
> and not necessarily the same thing as "return the PRIMARY KEY".
>
> Should we return the DEFAULT on a UNIQUE column, for example?
>
> IMO other vendors' drivers should be tested for behaviour in a variety of
> cases.

Yeah.  It was asserted in the earlier thread that other vendors implement
this feature as "return the pkey", but that seems to conflict with the
plain language of the JDBC spec: generated columns are an entirely
different thing than primary key columns.  So really what I'd like to see
is some work on surveying other implementations to confirm exactly what
behavior they implement.  If we're to go against what the spec seems to
say, I want to see a whole lot of evidence that other people do it
consistently in a different way.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: How can we expand PostgreSQL ecosystem?
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Freeze avoidance of very large table.