PostgreSQL current_user
PostgreSQL current_user 返回当前用户(当前执行上下文的用户)的名称。
current_user 与 current_role() 等效。
current_user 语法
这里是 PostgreSQL current_user 的语法:
current_user -> name
参数
PostgreSQL current_user 无需任何参数。
返回值
PostgreSQL current_user 返回当前用户(当前执行上下文的用户)的名称。
current_user 示例
要获取当前执行上下文的用户,请使用下面带有 current_user 的 SELECT 语句:
SELECT current_user;
 current_user
--------------
 postgres