Re: MERGE vs REPLACE - Mailing list pgsql-hackers

From Robert Treat
Subject Re: MERGE vs REPLACE
Date
Msg-id 200511131227.45508.xzilla@users.sourceforge.net
Whole thread Raw
In response to Re: MERGE vs REPLACE  (Gregory Maxwell <gmaxwell@gmail.com>)
Responses Re: MERGE vs REPLACE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sunday 13 November 2005 10:01, Gregory Maxwell wrote:
> On 11/13/05, Robert Treat <xzilla@users.sourceforge.net> wrote:
> > On Saturday 12 November 2005 04:06, Matteo Beccati wrote:
> > > | 1 |    1 | NULL |
> >
> > Wow, that seems ugly.... maybe there's a reason for it, but I'm not sure
> > we could deviate from my$ql's behavior on this even if we wanted... they
> > are the "standard" here.
>
> I don't think that's ugly, I think that's exactly working as
> advertised. Replace behaves exactly like deleting the record with the
> matching primary key and inserting the provided input. ... not merging
> together old data with new.

I disagree in that REPLACE is advertised as a solution for the INSERT else 
UPDATE problem, but has a different behavior than a true INSERT else UPDATE 
would produce.   Maybe that's a problem with the implementation, or maybe 
it's a problem in the advertisment, but there is certainly a discrepency 
there. 

-- 
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [JDBC] prepareThreshold=1 and statement.executeBatch() ??
Next
From: Tom Lane
Date:
Subject: Re: MERGE vs REPLACE