aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e7d486ca2fc..3f427f1b47f 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -1648,6 +1648,7 @@ exec_bind_message(StringInfo input_message)
char msec_str[32];
ParamsErrorCbData params_data;
ErrorContextCallback params_errcxt;
+ ListCell *lc;
/* Get the fixed part of the message */
portal_name = pq_getmsgstring(input_message);
@@ -1683,6 +1684,17 @@ exec_bind_message(StringInfo input_message)
pgstat_report_activity(STATE_RUNNING, psrc->query_string);
+ foreach(lc, psrc->query_list)
+ {
+ Query *query = lfirst_node(Query, lc);
+
+ if (query->queryId != UINT64CONST(0))
+ {
+ pgstat_report_query_id(query->queryId, false);
+ break;
+ }
+ }
+
set_ps_display("BIND");
if (save_log_statement_stats)
@@ -2109,6 +2121,7 @@ exec_execute_message(const char *portal_name, long max_rows)
ErrorContextCallback params_errcxt;
const char *cmdtagname;
size_t cmdtaglen;
+ ListCell *lc;
/* Adjust destination to tell printtup.c what to do */
dest = whereToSendOutput;
@@ -2155,6 +2168,17 @@ exec_execute_message(const char *portal_name, long max_rows)
pgstat_report_activity(STATE_RUNNING, sourceText);
+ foreach(lc, portal->stmts)
+ {
+ PlannedStmt *stmt = lfirst_node(PlannedStmt, lc);
+
+ if (stmt->queryId != UINT64CONST(0))
+ {
+ pgstat_report_query_id(stmt->queryId, false);
+ break;
+ }
+ }
+
cmdtagname = GetCommandTagNameAndLen(portal->commandTag, &cmdtaglen);
set_ps_display_with_len(cmdtagname, cmdtaglen);