Re: Best practices: MERGE

From: David Fetter <david(at)fetter(dot)org>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Best practices: MERGE
Date: 2005-03-08 08:25:46
Message-ID: 20050308082546.GA31516@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

Attachment Content-Type Size
upsert.diff text/plain 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-03-08 08:28:06 Re: Best practices: MERGE
Previous Message Tom Lane 2005-03-08 08:07:13 Re: BUG #1528: Rows returned that should be excluded by WHERE clause

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2005-03-08 08:28:06 Re: Best practices: MERGE
Previous Message Mark Kirkwood 2005-03-08 08:25:16 Re: Display Pg buffer cache (WIP)