Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: rwestlun(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE
Date: 2016-01-25 10:00:38
Message-ID: 56A5F246.3070300@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 25/01/16 08:48, rwestlun(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitriy Sarafannikov 2016-01-25 10:46:37 Re[2]: [BUGS] Re[2]: [BUGS] Wal sender segfault
Previous Message rwestlun 2016-01-25 07:48:06 BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE