Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aNdxV-0007iJ-Sn for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Jan 2016 10:01:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aNdxV-0000xy-Fb for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Jan 2016 10:01:17 +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 1aNdws-0000Ep-5f for pgsql-bugs@postgresql.org; Mon, 25 Jan 2016 10:00:38 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aNdwp-0005ZU-Ey for pgsql-bugs@postgresql.org; Mon, 25 Jan 2016 10:00:37 +0000 Received: by mail-lf0-x232.google.com with SMTP id h129so81852624lfh.3 for ; Mon, 25 Jan 2016 02:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joh-to.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=TuTOUGk8P433hJ8YLF2g6GgPWe3MZkG0s2GnDmEBgC4=; b=TdFtDK2AtZGYRI9S+10R7Av7+r+wJwsISOpYubR9R181AMpya32I9uYsd1SV+t4DOq xfQeyJOIVeRtokKF3YvjQSGj76S+8NhrCujbWaghDUvVS1Qz03TvKQj13AH51MD7ecEg QsCphdJ6P8gjaBd5YZzJdp09hDCbtgfnywJBlmdn2IqU/mnnJQ7I1HzyBgfGGFV4/dMH YSRg11SOIJNydiMSr3KS5ESax5NW4vaMjF2vkbAJJ/sev2QMutaaareLkCDly4NmwO2B ZvEjv6ljlsUzZXbla9vVqLqxwYL3xD1MNEdUIC+KjQl344x3B2spI296jJ+ZNjdXS2yO thpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=TuTOUGk8P433hJ8YLF2g6GgPWe3MZkG0s2GnDmEBgC4=; b=NV7joDqpXFtRrjLginLGuKHWE8J+N8u6QzVlxtxmgdPO7DX4XlpaSpRlVHroREKHYH G39K7tpaJkS5ltVoSXCgBzO9JVuHL8m2u42Gqjz+9L2UTK+0MziRe9eDLAeuIgo2p912 njsC/x8Zg6HCbaUGrRREBknYS6ejKEmjVbGs5OLtTl82WbiaQsPOha3b3EOiupCsPEJl yYfI9v2vhEEKzYcr5Ux16bkOhR3l4zMKT2YKP9vNnR0cFXVut5DuluYuDRPPsFWCy5zv 96zcCCSb1gE1gR5x3eGXMoMhWLEhC0e/4eHKPtJCstxyF784uc9b9B2uzBxNftoTDKOD jg+g== X-Gm-Message-State: AG10YOTky6xDnBdT1YwgwxZ2hEA9rfJsE5LGCfXWOFM/Zd0c/vUXmS29L/lJdhGAOyFayw== X-Received: by 10.25.4.214 with SMTP id 205mr4694290lfe.90.1453716034790; Mon, 25 Jan 2016 02:00:34 -0800 (PST) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by smtp.googlemail.com with ESMTPSA id wj2sm2542026lbb.5.2016.01.25.02.00.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jan 2016 02:00:34 -0800 (PST) Subject: Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE To: rwestlun@gmail.com, pgsql-bugs@postgresql.org References: <20160125074806.2555.44482@wrigleys.postgresql.org> From: Marko Tiikkaja Message-ID: <56A5F246.3070300@joh.to> Date: Mon, 25 Jan 2016 11:00:38 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160125074806.2555.44482@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 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. That seems a bit short-sighted. What should happen if one row was added and one updated? FWIW, I would've expected to be able to do RETURNING excluded.foo which would have been NULL in case of INSERT, and the value from the updated tuple otherwise. But that doesn't seem to work. .m -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs