简体   繁体   English

PostgreSQL用户的存储过程名称

[英]PostgreSQL Stored Procedure Name of User

I was wondering if there was a way to detect the log in name of the user executing the query which triggers a stored procedure? 我想知道是否有一种方法可以检测执行查询的用户的登录名,从而触发存储过程? Say, I have a trigger on table_a that fires when a particular column is changed. 说,我在table_a上有一个触发器,当更改特定列时将触发该触发器。 I would like to retrieve the name of the logged in user who executed the query which triggered the stored procedure running. 我想检索执行查询以触发存储过程运行的登录用户的名称。

Is this possible? 这可能吗?

事实证明,有一个公认的关键字current_user可以执行我想要的确切操作-保留执行查询的当前用户的用户名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM