aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-05-23 00:49:27 +0200
committerAndres Freund <andres@anarazel.de>2015-05-23 00:58:45 +0200
commit631d7490074cdaef8026db57a5f2772b8730f600 (patch)
tree56d0aee92bbe994583e095111f9ea23135c31d1c /doc/src
parent49ad32d5d99cb4a79bf648c0b7f9eca19b54cf1d (diff)
downloadpostgresql-631d7490074cdaef8026db57a5f2772b8730f600.tar.gz
postgresql-631d7490074cdaef8026db57a5f2772b8730f600.zip
Remove the new UPSERT command tag and use INSERT instead.
Previously, INSERT with ON CONFLICT DO UPDATE specified used a new command tag -- UPSERT. It was introduced out of concern that INSERT as a command tag would be a misrepresentation for ON CONFLICT DO UPDATE, as some affected rows may actually have been updated. Alvaro Herrera noticed that the implementation of that new command tag was incomplete; in subsequent discussion we concluded that having it doesn't provide benefits that are in line with the compatibility breaks it requires. Catversion bump due to the removal of PlannedStmt->isUpsert. Author: Peter Geoghegan Discussion: 20150520215816.GI5885@postgresql.org
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/protocol.sgml13
-rw-r--r--doc/src/sgml/ref/insert.sgml21
2 files changed, 10 insertions, 24 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index d985204566c..c7df697845e 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -3011,16 +3011,9 @@ CommandComplete (B)
<literal>INSERT <replaceable>oid</replaceable>
<replaceable>rows</replaceable></literal>, where
<replaceable>rows</replaceable> is the number of rows
- inserted. However, if and only if <literal>ON CONFLICT
- UPDATE</> is specified, then the tag is <literal>UPSERT
- <replaceable>oid</replaceable>
- <replaceable>rows</replaceable></literal>, where
- <replaceable>rows</replaceable> is the number of rows inserted
- <emphasis>or updated</emphasis>.
- <replaceable>oid</replaceable> is the object ID of the
- inserted row if <replaceable>rows</replaceable> is 1 and the
- target table has OIDs, and (for the <literal>UPSERT</literal>
- tag), the row was actually inserted rather than updated;
+ inserted. <replaceable>oid</replaceable> is the object ID
+ of the inserted row if <replaceable>rows</replaceable> is 1
+ and the target table has OIDs;
otherwise <replaceable>oid</replaceable> is 0.
</para>
diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml
index 3c3315eab3d..7cd4577f1ea 100644
--- a/doc/src/sgml/ref/insert.sgml
+++ b/doc/src/sgml/ref/insert.sgml
@@ -497,20 +497,13 @@ INSERT INTO <replaceable class="PARAMETER">table_name</replaceable> [ AS <replac
<screen>
INSERT <replaceable>oid</replaceable> <replaceable class="parameter">count</replaceable>
</screen>
- However, in the event of an <literal>ON CONFLICT DO UPDATE</> clause
- (but <emphasis>not</emphasis> in the event of an <literal>ON
- CONFLICT DO NOTHING</> clause), the command tag reports the number of
- rows inserted or updated together, of the form
-<screen>
-UPSERT <replaceable>oid</replaceable> <replaceable class="parameter">count</replaceable>
-</screen>
- The <replaceable class="parameter">count</replaceable> is the number
- of rows inserted. If <replaceable class="parameter">count</replaceable>
- is exactly one, and the target table has OIDs, then
- <replaceable class="parameter">oid</replaceable> is the
- <acronym>OID</acronym>
- assigned to the inserted row (but not if there is only a single
- updated row). Otherwise <replaceable
+ The <replaceable class="parameter">count</replaceable> is the
+ number of rows inserted or updated. If <replaceable
+ class="parameter">count</replaceable> is exactly one, and the
+ target table has OIDs, then <replaceable
+ class="parameter">oid</replaceable> is the <acronym>OID</acronym>
+ assigned to the inserted row. The single row must have been
+ inserted rather than updated. Otherwise <replaceable
class="parameter">oid</replaceable> is zero.
</para>