Commit c26552f4 authored by David Rowley's avatar David Rowley

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
parent 9268fc34
...@@ -606,10 +606,12 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, ...@@ -606,10 +606,12 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
if (es->verbose && plannedstmt->queryId != UINT64CONST(0)) if (es->verbose && plannedstmt->queryId != UINT64CONST(0))
{ {
char buf[MAXINT8LEN + 1]; /*
* Output the queryid as an int64 rather than a uint64 so we match
pg_lltoa(plannedstmt->queryId, buf); * what would be seen in the BIGINT pg_stat_statements.queryid column.
ExplainPropertyText("Query Identifier", buf, es); */
ExplainPropertyInteger("Query Identifier", NULL, (int64)
plannedstmt->queryId, es);
} }
/* Show buffer usage in planning */ /* Show buffer usage in planning */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment