On Fri, Jun 26, 2015 at 3:39 PM, Peter Geoghegan <[email protected]> wrote:
> On Wed, Jun 10, 2015 at 9:15 PM, Bruce Momjian <[email protected]> wrote:
>> I am ready to make suggested adjustments
Also, I attach a new description of the UPSERT feature. For me, UPSERT
was always about guarantees that make statements work robustly under
standard operating conditions -- a novice user should be able to write
a simple UPSERT statement and forget about it. It's really hard to
explain how that can be guaranteed, but the basic guarantee itself is
simple, and matters a lot.
I think that the proposed wording conveys that. I also think that it's
important that this message is prominently conveyed, because these
issues cause no end of confusion.
--
Peter Geoghegan
diff --git a/doc/src/sgml/release-9.5.sgml b/doc/src/sgml/release-9.5.sgml
index 5b0d109..94cecd7 100644
--- a/doc/src/sgml/release-9.5.sgml
+++ b/doc/src/sgml/release-9.5.sgml
@@ -620,16 +620,23 @@
<listitem>
<para>
- Allow <link linkend="sql-on-conflict"><command>INSERTS</></>
- that would generate constraint conflicts to be turned into
- <command>UPDATE</>s or ignored (Peter Geoghegan, Heikki
- Linnakangas, Andres Freund)
+ Allow <command>INSERT</>s to specify an alternative
+ <literal>DO UPDATE</> or <literal>DO NOTHING</> action that is
+ executed upon encountering an <literal><link
+ linkend="sql-on-conflict">ON CONFLICT</></> condition (Peter
+ Geoghegan, Heikki Linnakangas, Andres Freund)
</para>
<para>
- The syntax is <command>INSERT ... ON CONFLICT DO NOTHING/UPDATE</>.
- This is the Postgres implementation of the popular
- <command>UPSERT</> command.
+ The <command>INSERT</> syntax is revised to accept an
+ <literal>ON CONFLICT DO NOTHING/UPDATE</> clause. <literal>ON
+ CONFLICT</> conditions are conditions that ordinarily result
+ in a uniqueness violation or exclusion violation error. In
+ the absence of any independent error, <literal>ON CONFLICT DO
+ UPDATE</> guarantees either inserting any row proposed for
+ insertion, or, alternatively, resolving a conflict by updating
+ an existing, conflicting row. This capability is generally
+ known as <quote>UPSERT</>.
</para>
</listitem>
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers