Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yvb8O-0002A8-Ls for pgsql-hackers@arkaria.postgresql.org; Fri, 22 May 2015 00:48:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yvb8O-0004rm-52 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 May 2015 00:48:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yvb8N-0004re-0t for pgsql-hackers@postgresql.org; Fri, 22 May 2015 00:48:19 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Yvb8K-0001eE-DU for pgsql-hackers@postgresql.org; Fri, 22 May 2015 00:48:18 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id E22A2860001; Fri, 22 May 2015 02:48:14 +0200 (CEST) Date: Fri, 22 May 2015 02:48:11 +0200 From: Andres Freund To: Alvaro Herrera Cc: Tom Lane , Peter Geoghegan , Pg Hackers Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. Message-ID: <20150522004811.GD2028@alap3.anarazel.de> References: <20150520215816.GI5885@postgresql.org> <20150520220911.GK5885@postgresql.org> <20150521011229.GX27868@alap3.anarazel.de> <10660.1432171328@sss.pgh.pa.us> <20150521013059.GY27868@alap3.anarazel.de> <20150521232841.GO5885@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150521232841.GO5885@postgresql.org> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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