|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.134 2010/01/02 16:57:52 momjian Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/tcop/pquery.c,v 1.135 2010/02/13 22:45:41 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1318,9 +1318,14 @@ PortalRunMulti(Portal portal, bool isTopLevel,
|
1318 | 1318 | * If a command completion tag was supplied, use it. Otherwise use the
|
1319 | 1319 | * portal's commandTag as the default completion tag.
|
1320 | 1320 | *
|
1321 |
| - * Exception: clients will expect INSERT/UPDATE/DELETE tags to have |
1322 |
| - * counts, so fake something up if necessary. (This could happen if the |
1323 |
| - * original query was replaced by a DO INSTEAD rule.) |
| 1321 | + * Exception: Clients expect INSERT/UPDATE/DELETE tags to have |
| 1322 | + * counts, so fake them with zeros. This can happen with DO INSTEAD |
| 1323 | + * rules if there is no replacement query of the same type as the |
| 1324 | + * original. We print "0 0" here because technically there is no |
| 1325 | + * query of the matching tag type, and printing a non-zero count for |
| 1326 | + * a different query type seems wrong, e.g. an INSERT that does |
| 1327 | + * an UPDATE instead should not print "0 1" if one row |
| 1328 | + * was updated. See QueryRewrite(), step 3, for details. |
1324 | 1329 | */
|
1325 | 1330 | if (completionTag&&completionTag[0]=='\0')
|
1326 | 1331 | {
|
|