Commit fa66de98 authored by Bruce Momjian's avatar Bruce Momjian

>>>>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.
>>

David Fetter
parent bd32a255
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.66 2005/04/19 03:37:20 momjian Exp $ $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.67 2005/04/19 03:55:43 momjian Exp $
--> -->
<chapter id="plpgsql"> <chapter id="plpgsql">
...@@ -2104,6 +2104,7 @@ END; ...@@ -2104,6 +2104,7 @@ END;
</para> </para>
</tip> </tip>
<example id="plpgsql-upsert-example"> <example id="plpgsql-upsert-example">
<title>Exceptions with UPDATE/INSERT</title>
<para> <para>
This example uses an <literal>EXCEPTION</> to <command>UPDATE</> or This example uses an <literal>EXCEPTION</> to <command>UPDATE</> or
<command>INSERT</>, as appropriate. <command>INSERT</>, as appropriate.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment