Re: ask for review of MERGE - Mailing list pgsql-hackers

From Greg Smith
Subject Re: ask for review of MERGE
Date
Msg-id 4CC4A780.10301@2ndquadrant.com
Whole thread Raw
In response to Re: ask for review of MERGE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: ask for review of MERGE
List 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@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services and Support  www.2ndQuadrant.us




pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: why does plperl cache functions using just a bool for is_trigger
Next
From: Jeff Davis
Date:
Subject: Range Types, discrete and/or continuous