pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Tiikkaja <marko@joh.to>
To: rwestlun@gmail.com
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE
Date: Mon, 25 Jan 2016 11:00:38 +0100
Message-ID: <56A5F246.3070300@joh.to> (raw)
In-Reply-To: <20160125074806.2555.44482@wrigleys.postgresql.org>
References: <20160125074806.2555.44482@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (7+ messages)  latest in thread

Message-ID: <56A5F246.3070300@joh.to>
Permalink:  ../56A5F246.3070300@joh.to/
Also on:    postgresql.org/message-id/56A5F246.3070300@joh.to

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: marko@joh.to, rwestlun@gmail.com
  Subject: Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE
  In-Reply-To: <56A5F246.3070300@joh.to>
  References: <20160125074806.2555.44482@wrigleys.postgresql.org> <56A5F246.3070300@joh.to>

* 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