Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aNmBm-0003s3-8S for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Jan 2016 18:48:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aNmBl-0002Ra-LQ for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Jan 2016 18:48:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aNmBk-0002QE-Sk for pgsql-bugs@postgresql.org; Mon, 25 Jan 2016 18:48:32 +0000 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aNmBi-0008K5-0x for pgsql-bugs@postgresql.org; Mon, 25 Jan 2016 18:48:32 +0000 Received: by mail-qg0-x236.google.com with SMTP id e32so116635761qgf.3 for ; Mon, 25 Jan 2016 10:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=x2uqYyUrEo41t5IFGKTtYZD0mJG7U/S3HD9uIYW7s5g=; b=x4FqQ64Nx33IdyCJcNoEAigttOAdz/i5P6ntmTgcZulfSPOj3f/P4EQkIAXJiMY42L QhY0kmCQEdcNKDS3RvFsY2mk4tZBfJhNQ773WsTR+UC/8spH8MVMf8UMwQNkf8u2mYUN rN2FcWGP8CHsisMvhChQvlsd0HwDIxXJ6LsU5w2FwGme9L7HRZI7yy1dH5jDy75kAoHY GmZzK3Hxt/St60hc18RfhWTlWiSdDvgmk1GC3qUDPOLQQK7ty0IAtNrUstU8IBunJlCg 9tyliugPfEMv3Y7uKIAKcHwIk5qH0eslXFcU+pu5IjY+qyk42UXf4pP/b22jBp4wH1y0 UVvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=x2uqYyUrEo41t5IFGKTtYZD0mJG7U/S3HD9uIYW7s5g=; b=LZaCnoKOcT8ldMjZi3GviDB/dJf0eW/HcOj5ihTTWMOS2rKfqt0Ckw6xwgJ47eRF75 TSirpfveB+s4FXbmbOQnRe4f8oV+SdyNUT6Jn/HpyGNgPp3Ya1qRXwI6wdkhMHiT9SFG 80Ok80yJd5as3vtFeRfM0767N9E9ewJpPZc4GIKwWeTw1LfcUmmMB0tBzH7B5org11MD DJrrlYWk1ZX3EkTik95eaN2Fchk1kN/z4i4N1J1vXfJ3en49D+z5NAzkF5lbi5aKPJYv m61dygE11i5BPv9vTYWnolV6JCmHh830vtFbmZWF6WL5SECFuJ9VKUPsddj3lutwri5k RTMg== X-Gm-Message-State: AG10YOTy/S9huxxeqDY3YR9FHuJQ3CNPVq3od6EGHVCOAr6zdMJOlFrpvWq+oodfTZ5PbA== X-Received: by 10.140.248.213 with SMTP id t204mr24338484qhc.97.1453747707996; Mon, 25 Jan 2016 10:48:27 -0800 (PST) Received: from gmail.com (c-98-216-247-110.hsd1.ma.comcast.net. [98.216.247.110]) by smtp.gmail.com with ESMTPSA id w140sm9156731qhb.37.2016.01.25.10.48.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2016 10:48:27 -0800 (PST) Date: Mon, 25 Jan 2016 13:48:25 -0500 From: Randy Westlund To: Marko Tiikkaja Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE Message-ID: <20160125184825.GB44462@gmail.com> References: <20160125074806.2555.44482@wrigleys.postgresql.org> <56A5F246.3070300@joh.to> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline In-Reply-To: <56A5F246.3070300@joh.to> User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 25, 2016 at 11:00:38AM +0100, Marko Tiikkaja wrote: > On 25/01/16 08:48, rwestlun@gmail.com wrote: > > I believe postgres should be returning "UPDATE" here instead of "INSERT" > > because I see no way to know which operation took place. >=20 > That seems a bit short-sighted. What should happen if one row was added= =20 > and one updated? That's a good point. I'm not sure what the proper way to determine which operation took place should be :/ --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWpm35AAoJEGaweXjzNsmpfZwH/ArHpzRmnU5g3dc0jvy1wThf lJO5v/fjvg2PBQQoQfU3bnS2aq3t2YFXkeH53X2rxKV4UwQ8BGUhG4J2xt99uz0s dvBMtQkHnRjgySUe9oBMAK2iXJTaY0lhI/qcVaW556nV4920WaQe+R8eB+GPMzAb ZdZnb8WVB1/oq7ij2S0zVn61DEDAoXXcz9yM9DGVulqFCubnN+OK7bDDJuNUTpfU 33BJ+3Bfzshi6n9N8on+O8qEYRmgg1Zb4RRzubQgKbAFgg58zQg7GuM7X9zAK+v3 a0qaLTnu3hNKlgW+e8aqpKsudmbuCjYtsEzw3hzq9oQU+7hFH448hVbmKUXno7c= =HDow -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V--