aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-02-28 10:53:56 +0900
committerMichael Paquier <michael@paquier.xyz>2022-02-28 10:53:56 +0900
commit667726fbe50f21d7d3ce5d5c5949a45c2496b60f (patch)
tree8d26330d539c1f7d17bace5c54dfa416ee9cc08e
parentd1b307eef2818fe24760cc2c168d7d65d59775a8 (diff)
downloadpostgresql-667726fbe50f21d7d3ce5d5c5949a45c2496b60f.tar.gz
postgresql-667726fbe50f21d7d3ce5d5c5949a45c2496b60f.zip
pg_stat_statements: Remove unnecessary call to GetUserId()
The same is done a couple of lines above, so there is no need for the same, extra, call. Author: Dong Wook Lee Reviewed-by: Julien Rouhaud Discussion: https://postgr.es/m/CAAcBya+szDd1Y6dJU4_dbH_Ye3=G=8O1oQGG01kv3Tpie7wELQ@mail.gmail.com
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 38d92a89cc4..d803253ceaf 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -1508,7 +1508,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
pgssEntry *entry;
/* Superusers or members of pg_read_all_stats members are allowed */
- is_allowed_role = is_member_of_role(GetUserId(), ROLE_PG_READ_ALL_STATS);
+ is_allowed_role = is_member_of_role(userid, ROLE_PG_READ_ALL_STATS);
/* hash table must exist already */
if (!pgss || !pgss_hash)