*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.112 2007/01/05 22:19:39 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.113 2007/02/18 19:49:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
PortalCreateHoldStore(portal);
treceiver = CreateDestReceiver(DestTuplestore, portal);
+ completionTag[0] = '\0';
+
switch (portal->strategy)
{
case PORTAL_ONE_RETURNING:
* tuplestore. Auxiliary query outputs are discarded.
*/
PortalRunMulti(portal, treceiver, None_Receiver, completionTag);
- /* Override default completion tag with actual command result */
- portal->commandTag = pstrdup(completionTag);
break;
case PORTAL_UTIL_SELECT:
PortalRunUtility(portal, linitial(portal->parseTrees),
- treceiver, NULL);
+ treceiver, completionTag);
break;
default:
break;
}
+ /* Override default completion tag with actual command result */
+ if (completionTag[0] != '\0')
+ portal->commandTag = pstrdup(completionTag);
+
(*treceiver->rDestroy) (treceiver);
}