Re: MERGE vs REPLACE

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Gregory Maxwell <gmaxwell(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Matteo Beccati <php(at)beccati(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, peter_e(at)gmx(dot)net
Subject: Re: MERGE vs REPLACE
Date: 2005-11-13 17:27:45
Message-ID: 200511131227.45508.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sunday 13 November 2005 10:01, Gregory Maxwell wrote:
> On 11/13/05, Robert Treat <xzilla(at)users(dot)sourceforge(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-11-13 17:52:51 Re: MERGE vs REPLACE
Previous Message Jaime Casanova 2005-11-13 16:58:47 REPLACE implementation (was: Re: MERGE vs REPLACE)