Re: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE - Mailing list pgsql-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

pgsql-bugs by date:

Previous
From: rwestlun@gmail.com
Date:
Subject: BUG #13886: When INSERT ON CONFLICT DO UPDATE updates, it returns INSERT rather than UPDATE
Next
From: Dmitriy Sarafannikov
Date:
Subject: Re[2]: [BUGS] Re[2]: [BUGS] Wal sender segfault