Re: Best practices: MERGE - Mailing list pgsql-hackers

From David Fetter
Subject Re: Best practices: MERGE
Date
Msg-id 20050308082546.GA31516@fetter.org
Whole thread Raw
In response to Re: Best practices: MERGE  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: Best practices: MERGE
List pgsql-hackers
On Tue, Mar 08, 2005 at 12:27:21PM +0800, Christopher Kings-Lynne wrote:
> >Luckily, PG 8 is available for this.  Do you have a short example?
>
> No, and I think it should be in the manual as an example.
>
> You will need to enter a loop that uses exception handling to detect
> unique_violation.

Pursuant to an IRC discussion to which Dennis Bjorklund and
Christopher Kings-Lynne made most of the contributions, please find
enclosed an example patch demonstrating an UPSERT-like capability.

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Indicies work on FreeBSD, not on Linux
Next
From: Simon Riggs
Date:
Subject: Re: Best practices: MERGE