merge_stat.patch
text/x-diff
Filename: merge_stat.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| doc/src/sgml/pgstatstatements.sgml | 2 | 2 |
| src/backend/utils/misc/queryjumble.c | 10 | 0 |
diff --git a/doc/src/sgml/pgstatstatements.sgml b/doc/src/sgml/pgstatstatements.sgml
index ecf6cd6bf3..ea90365c7f 100644
--- a/doc/src/sgml/pgstatstatements.sgml
+++ b/doc/src/sgml/pgstatstatements.sgml
@@ -487,7 +487,7 @@
<para>
Plannable queries (that is, <command>SELECT</command>, <command>INSERT</command>,
- <command>UPDATE</command>, and <command>DELETE</command>) are combined into a single
+ <command>UPDATE</command>, <command>DELETE</command>, and <command>MERGE</command>) are combined into a single
<structname>pg_stat_statements</structname> entry whenever they have identical query
structures according to an internal hash calculation. Typically, two
queries will be considered the same for this purpose if they are
@@ -783,7 +783,7 @@
<varname>pg_stat_statements.track_utility</varname> controls whether
utility commands are tracked by the module. Utility commands are
all those other than <command>SELECT</command>, <command>INSERT</command>,
- <command>UPDATE</command> and <command>DELETE</command>.
+ <command>UPDATE</command>, <command>DELETE</command>, and <command>MERGE</command>.
The default value is <literal>on</literal>.
Only superusers can change this setting.
</para>
diff --git a/src/backend/utils/misc/queryjumble.c b/src/backend/utils/misc/queryjumble.c
index a67487e5fe..6417f6e868 100644
--- a/src/backend/utils/misc/queryjumble.c
+++ b/src/backend/utils/misc/queryjumble.c
@@ -257,6 +257,7 @@ JumbleQueryInternal(JumbleState *jstate, Query *query)
JumbleExpr(jstate, (Node *) query->windowClause);
JumbleExpr(jstate, (Node *) query->distinctClause);
JumbleExpr(jstate, (Node *) query->sortClause);
+ JumbleExpr(jstate, (Node *) query->mergeActionList);
JumbleExpr(jstate, query->limitOffset);
JumbleExpr(jstate, query->limitCount);
APP_JUMB(query->limitOption);
@@ -823,6 +824,15 @@ JumbleExpr(JumbleState *jstate, Node *node)
JumbleExpr(jstate, (Node *) tsc->repeatable);
}
break;
+ case T_MergeAction:
+ {
+ MergeAction *mergeaction = (MergeAction *) node;
+
+ APP_JUMB(mergeaction->commandType);
+ JumbleExpr(jstate, mergeaction->qual);
+ JumbleExpr(jstate, (Node *) mergeaction->targetList);
+ }
+ break;
default:
/* Only a warning, since we can stumble along anyway */
elog(WARNING, "unrecognized node type: %d",