Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0fef877

Browse files
Rename session_auth_is_superuser to current_role_is_superuser.
This variable might've been accurately named when it was added in ea88633, but the name hasn't been accurate since at least the introduction of SET ROLE in e5d6b91. The corresponding documentation was fixed in eedb068. This commit renames the variable accordingly. Suggested-by: Joseph Koshakow Discussion: https://postgr.es/m/CAAvxfHc-HHzONQ2oXdvhFF9ayRnidPwK%2BfVBhRzaBWYYLVQL-g%40mail.gmail.com
1 parent 411b720 commit 0fef877

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/backend/access/transam/parallel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ InitializeParallelDSM(ParallelContext *pcxt)
327327
fps->database_id = MyDatabaseId;
328328
fps->authenticated_user_id = GetAuthenticatedUserId();
329329
fps->outer_user_id = GetCurrentRoleId();
330-
fps->is_superuser = session_auth_is_superuser;
330+
fps->is_superuser = current_role_is_superuser;
331331
GetUserIdAndSecContext(&fps->current_user_id, &fps->sec_context);
332332
GetTempNamespaceState(&fps->temp_namespace_id,
333333
&fps->temp_toast_namespace_id);

src/backend/utils/misc/guc_tables.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ bool check_function_bodies = true;
511511
* details.
512512
*/
513513
bool default_with_oids = false;
514-
bool session_auth_is_superuser;
514+
bool current_role_is_superuser;
515515

516516
int log_min_error_statement = ERROR;
517517
int log_min_messages = WARNING;
@@ -1037,13 +1037,16 @@ struct config_bool ConfigureNamesBool[] =
10371037
NULL, NULL, NULL
10381038
},
10391039
{
1040-
/* Not for general use --- used by SET SESSION AUTHORIZATION */
1040+
/*
1041+
* Not for general use --- used by SET SESSION AUTHORIZATION and SET
1042+
* ROLE
1043+
*/
10411044
{"is_superuser", PGC_INTERNAL, UNGROUPED,
10421045
gettext_noop("Shows whether the current user is a superuser."),
10431046
NULL,
10441047
GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
10451048
},
1046-
&session_auth_is_superuser,
1049+
&current_role_is_superuser,
10471050
false,
10481051
NULL, NULL, NULL
10491052
},

src/include/utils/guc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ extern PGDLLIMPORT bool log_statement_stats;
250250
extern PGDLLIMPORT bool log_btree_build_stats;
251251

252252
extern PGDLLIMPORT bool check_function_bodies;
253-
extern PGDLLIMPORT bool session_auth_is_superuser;
253+
extern PGDLLIMPORT bool current_role_is_superuser;
254254

255255
extern PGDLLIMPORT bool log_duration;
256256
extern PGDLLIMPORT int log_parameter_max_length;

0 commit comments

Comments
 (0)