aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r--src/backend/commands/variable.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index c2d7a5bebf6..c7e5a9ca9fa 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -744,6 +744,7 @@ bool
check_session_authorization(char **newval, void **extra, GucSource source)
{
HeapTuple roleTup;
+ Form_pg_authid roleform;
Oid roleid;
bool is_superuser;
role_auth_extra *myextra;
@@ -770,8 +771,9 @@ check_session_authorization(char **newval, void **extra, GucSource source)
return false;
}
- roleid = HeapTupleGetOid(roleTup);
- is_superuser = ((Form_pg_authid) GETSTRUCT(roleTup))->rolsuper;
+ roleform = (Form_pg_authid) GETSTRUCT(roleTup);
+ roleid = roleform->oid;
+ is_superuser = roleform->rolsuper;
ReleaseSysCache(roleTup);
@@ -815,6 +817,7 @@ check_role(char **newval, void **extra, GucSource source)
Oid roleid;
bool is_superuser;
role_auth_extra *myextra;
+ Form_pg_authid roleform;
if (strcmp(*newval, "none") == 0)
{
@@ -842,8 +845,9 @@ check_role(char **newval, void **extra, GucSource source)
return false;
}
- roleid = HeapTupleGetOid(roleTup);
- is_superuser = ((Form_pg_authid) GETSTRUCT(roleTup))->rolsuper;
+ roleform = (Form_pg_authid) GETSTRUCT(roleTup);
+ roleid = roleform->oid;
+ is_superuser = roleform->rolsuper;
ReleaseSysCache(roleTup);