Re: UPDATE on two large datasets is very slow - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: UPDATE on two large datasets is very slow
Date
Msg-id 20070404152432.GE22542@svana.org
Whole thread Raw
In response to Re: UPDATE on two large datasets is very slow  (Tommy Gildseth <tommy@gildseth.com>)
List pgsql-general
On Wed, Apr 04, 2007 at 11:34:22AM +0200, Tommy Gildseth wrote:
> >For the record, this is what the SQL MERGE command is for... I don't
> >think anyone is working on implementing that though...
> >
> This will possibly provide a solution to this question:
> http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE

Almost. Merge will allow you to combine the INSERT and UPDATE into a
single command. It doesn't avoid the race condition though, so you
still need the exception block and the loop.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Froggy / Froggy Corp."
Date:
Subject: Re: Problem with a transaction on dump
Next
From: "pobox@verysmall.org"
Date:
Subject: Re: use superuser connection from php