result->queryId = parse->queryId;
result->hasReturning = (parse->returningList != NIL);
result->hasModifyingCTE = parse->hasModifyingCTE;
- result->isUpsert =
- (parse->onConflict && parse->onConflict->action == ONCONFLICT_UPDATE);
result->canSetTag = parse->canSetTag;
result->transientPlan = glob->transientPlan;
result->planTree = top_plan;
lastOid = queryDesc->estate->es_lastoid;
else
lastOid = InvalidOid;
- if (plan->isUpsert)
- snprintf(completionTag, COMPLETION_TAG_BUFSIZE,
- "UPSERT %u %u",
- lastOid, queryDesc->estate->es_processed);
- else
- snprintf(completionTag, COMPLETION_TAG_BUFSIZE,
- "INSERT %u %u",
- lastOid, queryDesc->estate->es_processed);
+ snprintf(completionTag, COMPLETION_TAG_BUFSIZE,
+ "INSERT %u %u", lastOid, queryDesc->estate->es_processed);
break;
case CMD_UPDATE:
snprintf(completionTag, COMPLETION_TAG_BUFSIZE,
* 0" here because technically there is no query of the matching tag type,
* and printing a non-zero count for a different query type seems wrong,
* e.g. an INSERT that does an UPDATE instead should not print "0 1" if
- * one row was updated (unless the ON CONFLICT DO UPDATE, or "UPSERT"
- * variant of INSERT was used to update the row, where it's logically a
- * direct effect of the top level command). See QueryRewrite(), step 3,
- * for details.
+ * one row was updated. See QueryRewrite(), step 3, for details.
*/
if (completionTag && completionTag[0] == '\0')
{
sprintf(completionTag, "SELECT 0 0");
else if (strcmp(completionTag, "INSERT") == 0)
strcpy(completionTag, "INSERT 0 0");
- else if (strcmp(completionTag, "UPSERT") == 0)
- strcpy(completionTag, "UPSERT 0 0");
else if (strcmp(completionTag, "UPDATE") == 0)
strcpy(completionTag, "UPDATE 0");
else if (strcmp(completionTag, "DELETE") == 0)
success = StoreQueryTuple(results);
else
success = PrintQueryTuples(results);
- /*
- * if it's INSERT/UPSERT/UPDATE/DELETE RETURNING, also print status
- */
+ /* if it's INSERT/UPDATE/DELETE RETURNING, also print status */
cmdstatus = PQcmdStatus(results);
if (strncmp(cmdstatus, "INSERT", 6) == 0 ||
- strncmp(cmdstatus, "UPSERT", 6) == 0 ||
strncmp(cmdstatus, "UPDATE", 6) == 0 ||
strncmp(cmdstatus, "DELETE", 6) == 0)
PrintQueryStatus(results);