在PostgreSQL中,我们如何查看当前连接或会话的用户信息呢? 下面总结了几种方法:
方法1:
select * from current_user;
eg:
kerrydb=> select * from current_user;
current_user
--------------
test
(1 row)
方法2:
select user;
eg:
kerrydb=> select user;
user
------
test
(1 row)
kerrydb=>
方法3:
\c
此方法只适用于psql命令。
eg:
kerrydb=> \c
You are now connected to database "kerrydb" as user "test".
\conninfo
eg:
postgres=# \conninfo
You are connected to database "postgres" as user "postgres" on host "127.0.0.1" at port "5432".
:http://lady.shaoqun.com/a/391581.html
2021福田区公共体育场馆免费开放时间表及订场指南:http://www.30bags.com/a/462466.html
深圳大运中心7月1日免费开放(具体时间+场馆+预约入场指南):http://www.30bags.com/a/462467.html
没有评论:
发表评论