Re: Replaceing records

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Replaceing records
Date: 2003-09-04 17:06:42
Message-ID: Pine.GSU.4.44.0309041006140.4262-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think this would be very useful.

Jon

On 4 Sep 2003, Greg Stark wrote:

>
> Harald Fuchs <nospam(at)sap(dot)com> writes:
>
> > You can't. The only thing MySQL has to offer is
>
> Actually I found two things related to this:
>
> http://www.mysql.com/doc/en/INSERT.html
>
> http://www.mysql.com/doc/en/REPLACE.html
>
> You can do
> INSERT INTO tab (...) VALUES (...) ON DUPLICATE KEY UPDATE col=val, ...
>
> It seems to be newer than REPLACE.
>
> In any case, both seem doable in postgres since in its MVCC every update is a
> delete+insert anyways. It means doing the delete if necessary and doing the
> insert unconditionally.
>
> But I'm not sure how convinced the developers are of its usefulness beyond
> satisfying mysql migrations. I've never used mysql and I have seen a few times
> it might have been useful. Not a lot, but a few. And it seems to be a frequent
> question on the mailing list.
>
> --
> greg
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera Munoz 2003-09-04 17:08:23 Re: French translation
Previous Message Doug McNaught 2003-09-04 16:52:07 Re: postmaster processes