From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Date: Fri, 22 May 2015 02:48:11 +0200
Message-ID: <20150522004811.GD2028@alap3.anarazel.de> (raw)
In-Reply-To: <20150521232841.GO5885@postgresql.org>
References: <E1YqZCW-0000e6-Od@gemulon.postgresql.org>
<20150520215816.GI5885@postgresql.org>
<CAM3SWZRUhr1806zsF28CVRrB=b4t8PWv8d9x29z02xTQoFDyWA@mail.gmail.com>
<20150520220911.GK5885@postgresql.org>
<CAM3SWZQXP3Z=iXQ_+HwoqG7417JYf6HKDTmgk-4Xt05OEL_S_Q@mail.gmail.com>
<CAM3SWZT0Rex4CpZo+re_m2Dh7wunMNsbD-9ZSWWx=JSewW3OVg@mail.gmail.com>
<20150521011229.GX27868@alap3.anarazel.de>
<10660.1432171328@sss.pgh.pa.us>
<20150521013059.GY27868@alap3.anarazel.de>
<20150521232841.GO5885@postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 2015-05-21 20:28:41 -0300, Alvaro Herrera wrote:
> That said, I'm not sure about having it be the same, either: first, I
> don't think we need to update the fe-exec.c code at all -- I mean, all
> the things I see there are very old compatibility stuff; reporting the
> OID of the just-inserted row? Seriously, who has OIDs in user tables
> anymore? Surely we wouldn't try to do that for INSERT ON CONFLICT DO
> UPDATE at all ... if anyone wants that functionality, they can use
> RETURNING, which is far saner.
The oid currently is reported for UPSERT... I agree it's not worth much,
but it seems pointless to break it for a single command.
> As for PQcmdTuples, what would a single number returned mean? Are we
> returning the sum of both inserted and updated tuples?
Yes.
> Isn't this a bit odd?
Imo it's pretty much in line with what's done with INSTEAD OF, FDWs and
such.
> If the number is useful, then perhaps we should distinguish the cases;
> and if it's not useful, why not just return zero?
There's libraries/frameworks checking if an insert succeeded by looking
at that number, and it seems like a bad idea to needlessly break those.
So I think we're good with ripping it out. Peter?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de, alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, pg@heroku.com, pgsql-hackers@postgresql.org
Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
In-Reply-To: <20150522004811.GD2028@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox