Re: ask for review of MERGE

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Stark <gsstark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Boxuan Zhai <bxzhai2010(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ask for review of MERGE
Date: 2010-10-24 21:39:12
Message-ID: 4CC4A780.10301@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> Well, there's no guarantee that any index at all exists on the target
> table, so any solution based on index locks can't be fully general.
>

Sure, but in the most common use case I think we're targeting at first,
no indexes means there's also no unique constraints either. I don't
think people can reasonable expect to MERGE or anything else to
guarantee they won't accidentally create two rows that conflict via the
terms of some non-database enforced key.

I am too brain-dead this particular Sunday to think of exactly how to
deal with the 3-tuple case you described, except to say that I think
it's OK for complicated situations to give up and throw a serialization
error. I'm already collecting a list of pathological tests and will try
to add something based on your problem case, then see what we can do
with it later.

--
Greg Smith, 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services and Support www.2ndQuadrant.us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2010-10-24 21:40:25 why does plperl cache functions using just a bool for is_trigger
Previous Message Jeff Davis 2010-10-24 21:37:36 Range Types, discrete and/or continuous