src/backend/utils/init/miscinit.c
/*
 * Report current role id
 *		This follows the semantics of SET ROLE, ie return the outer-level ID
 *		not the current effective ID, and return InvalidOid when the setting
 *		is logically SET ROLE NONE.
 */
Report current role id
This follows the semantics of SET ROLE, ie return the outer-level ID
not the current effective ID, and return InvalidOid when the setting
is logically SET ROLE NONE.
Report current role id This follows the semantics of SET ROLE ie return the outer - level ID not the current effective ID and return InvalidOid when the setting is logically SET ROLE NONE .
Oid
GetCurrentRoleId(void)
{
	if (SetRoleIsActive)
		return OuterUserId;
	else
		return InvalidOid;
}
Oid GetCurrentRoleId ( void ) { if ( SetRoleIsActive ) return OuterUserId ; else return InvalidOid ; }
Report current role id
              This follows the semantics of SET ROLE, ie return the outer-level ID
              not the current effective ID, and return InvalidOid when the setting
              is logically SET ROLE NONE.
Report current role id This follows the semantics of SET ROLE ie return the outer - level ID not the current effective ID and return InvalidOid when the setting is logically SET ROLE NONE .