Re: "RETURNING PRIMARY KEY" syntax extension

From: Jochem van Dieten <jochemd(at)gmail(dot)com>
To:
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "RETURNING PRIMARY KEY" syntax extension
Date: 2014-06-12 09:46:02
Message-ID: CABPCP-3NGg-SLMAeBM1BYqJkJ0yjwgbFPuc5ZOBR-EdaCb9iXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 11, 2014 at 2:39 AM, Tom Lane wrote:
>
> I'm not even 100% sold that automatically returning the primary key
> is going to save any application logic. Could somebody point out
> *exactly* where an app is going to save effort with this type of
> syntax, compared to requesting the columns it wants by name?

I haven't checked the code, but I am hoping it will help with the problem
where a RETURNING * is added to a statement that is not an insert or update
by the JDBC driver. That has been reported on the JDBC list at least twice,
and the proposed workaround is neither very elegant nor very robust:
https://groups.google.com/forum/#!msg/pgsql.interfaces.jdbc/7WY60JX3qyo/-v1fqDqLQKwJ

Jochem

--
Jochem van Dieten
http://jochem.vandieten.net/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Muraviov 2014-06-12 09:49:05 Re: wrapping in extended mode doesn't work well with default pager
Previous Message Andres Freund 2014-06-12 09:41:12 Re: Shared memory changes in 9.4?