On 08/10/14 11:28, Peter Geoghegan wrote:
> On Wed, Oct 8, 2014 at 1:36 AM, Marti Raudsepp <marti@juffo.org> wrote:
>> But the
>> MERGE syntax, to me, strongly implies that insertion doesn't begin
>> before determining whether a conflict exists or not.
>
> I think you're right. Another strike against the MERGE syntax, then,
> since as I said we cannot even know what to check prior to having
> before row insert triggers fire.
>
True, but to me it also seems to be strike against using INSERT for this
as I don't really see how you can make triggers work in a sane way if
the UPSERT is implemented as part of INSERT (at least I haven't seen any
proposal that I would consider sane from the user point of view).
-- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services