Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rowley2021-08-09 03:46:28 +0000
committerDavid Rowley2021-08-09 03:46:28 +0000
commitc26552f4fc4fb72c64103ea877ea3c2a251856ad (patch)
tree95371ab2f447bc1a792c981f8ca162b94533a8b3 /src/backend
parent9268fc34526427a48bc27b5ac4727c7fb4cddf7a (diff)
Use ExplainPropertyInteger for queryid in EXPLAIN
This saves a few lines of code. Also add a comment to mention why we use ExplainPropertyInteger instead of ExplainPropertyUInteger given that queryid is a uint64 type. Author: David Rowley Reviewed-by: Julien Rouhaud Discussion: https://postgr.es/m/CAApHDvqhSLYpSU_EqUdN39w9Uvb8ogmHV7_3YhJ0S3aScGBjsg@mail.gmail.com Backpatch-through: 14, where this code was originally added
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/explain.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 340db2bac4d..fb87bbf5d35 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -606,10 +606,12 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
if (es->verbose && plannedstmt->queryId != UINT64CONST(0))
{
- char buf[MAXINT8LEN + 1];
-
- pg_lltoa(plannedstmt->queryId, buf);
- ExplainPropertyText("Query Identifier", buf, es);
+ /*
+ * Output the queryid as an int64 rather than a uint64 so we match
+ * what would be seen in the BIGINT pg_stat_statements.queryid column.
+ */
+ ExplainPropertyInteger("Query Identifier", NULL, (int64)
+ plannedstmt->queryId, es);
}
/* Show buffer usage in planning */