pg_stat_statements: Remove unnecessary call to GetUserId()
authorMichael Paquier
Mon, 28 Feb 2022 01:53:56 +0000 (10:53 +0900)
committerMichael Paquier
Mon, 28 Feb 2022 01:53:56 +0000 (10:53 +0900)
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

contrib/pg_stat_statements/pg_stat_statements.c

index 38d92a89cc42388e4427737416959f8cee240b7e..d803253ceaf74c2781473d703a01ace8993fbb76 100644 (file)
@@ -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)