On Wed, May 20, 2015 at 3:14 PM, Peter Geoghegan <[email protected]> wrote:
> I think you're right. The initial commit neglected to update that, and
> only handled it from ProcessQuery(). So it works for PlannedStmts, not
> raw parse trees.
Attached patch fixes this. Thanks for the report.
--
Peter Geoghegan
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index a95eff1..8fd5ee8 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -1898,7 +1898,14 @@ CreateCommandTag(Node *parsetree)
{
/* raw plannable queries */
case T_InsertStmt:
- tag = "INSERT";
+ {
+ InsertStmt *stmt = (InsertStmt *) parsetree;
+
+ tag = "INSERT";
+ if (stmt->onConflictClause &&
+ stmt->onConflictClause->action == ONCONFLICT_UPDATE)
+ tag = "UPSERT";
+ }
break;
case T_DeleteStmt:
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers