diff options
author | David Rowley <drowley@postgresql.org> | 2021-08-09 15:47:00 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2021-08-09 15:47:23 +1200 |
commit | 4a3d806f38f99fecf8f2a2bf7990a7ebea9b6c63 (patch) | |
tree | 8de5a50406b427e1401a9bb238e118269e18c17a /src/backend/commands/explain.c | |
parent | c9229d3d2b05b90fba32bd4afb5eb251b53b73be (diff) | |
download | postgresql-4a3d806f38f99fecf8f2a2bf7990a7ebea9b6c63.tar.gz postgresql-4a3d806f38f99fecf8f2a2bf7990a7ebea9b6c63.zip |
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/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 36fbe129cf4..10644dfac44 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 */ |