How can you get the active users connected to a postgreSQL database via SQL?

前端 未结 3 1149
后悔当初
后悔当初 2020-12-12 12:25

How can you get the active users connected to a postgreSQL database via SQL? This could be the userid\'s or number of users.

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 12:47

    Using balexandre's info:

    SELECT usesysid, usename FROM pg_stat_activity;
    

提交回复
热议问题