Re: someone working to add merge? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: someone working to add merge?
Date
Msg-id 20899.1131736841@sss.pgh.pa.us
Whole thread Raw
In response to Re: someone working to add merge?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: someone working to add merge?  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane wrote:
>> Surely they require a unique constraint --- else the behavior isn't
>> even well defined, is it?

> They require that the merge condition does not match for more than one 
> row, but since the merge condition can do just about anything, there is 
> no guarantee that a unique constraint encompasses it.

ISTM to be a reasonable implementation restriction that there be a
constraint by which the system can prove that there is at most one
matching row.  Per other comments in this thread, we'd not be the only
implementation making such a restriction.

(Certainly, if I were a DBA and were told that the performance of MERGE
would go to hell in a handbasket if I had no such constraint, I'd make
sure there was one.  I don't think there is very much of a use-case for
the general scenario.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: someone working to add merge?
Next
From: Peter Eisentraut
Date:
Subject: MERGE vs REPLACE