> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# current_role

> 获取当前用户激活的角色。

获取当前用户激活的角色。该函数从 3.0 版本开始支持。

## 语法

```Haskell theme={null}
current_role();
current_role;
```

## 参数说明

无

## 返回值说明

返回值的数据类型为 VARCHAR。

## 示例

```Plain theme={null}
mysql> select current_role();
+----------------+
| current_role() |
+----------------+
| db_admin       |
+----------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.