From 631d7490074cdaef8026db57a5f2772b8730f600 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Sat, 23 May 2015 00:49:27 +0200 Subject: 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 --- doc/src/sgml/protocol.sgml | 13 +++---------- doc/src/sgml/ref/insert.sgml | 21 +++++++-------------- 2 files changed, 10 insertions(+), 24 deletions(-) (limited to 'doc/src') 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) INSERT oid rows, where rows is the number of rows - inserted. However, if and only if ON CONFLICT - UPDATE is specified, then the tag is UPSERT - oid - rows, where - rows is the number of rows inserted - or updated. - oid is the object ID of the - inserted row if rows is 1 and the - target table has OIDs, and (for the UPSERT - tag), the row was actually inserted rather than updated; + inserted. oid is the object ID + of the inserted row if rows is 1 + and the target table has OIDs; otherwise oid is 0. 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 table_name [ AS INSERT oid count - However, in the event of an ON CONFLICT DO UPDATE clause - (but not in the event of an ON - CONFLICT DO NOTHING clause), the command tag reports the number of - rows inserted or updated together, of the form - -UPSERT oid count - - The count is the number - of rows inserted. If count - is exactly one, and the target table has OIDs, then - oid is the - OID - assigned to the inserted row (but not if there is only a single - updated row). Otherwise count is the + number of rows inserted or updated. If count is exactly one, and the + target table has OIDs, then oid is the OID + assigned to the inserted row. The single row must have been + inserted rather than updated. Otherwise oid is zero. -- cgit v1.2.3