ALTER SYSTEM KILL SESSION

    无。

    • 会话的SID和SERIAL(获取方法请参考示例)。

    • 表明会话将在命令执行后立即结束。

    1. openGauss=#
    2. SELECT sa.sessionid AS sid,0::integer AS serial#,ad.rolname AS username FROM pg_stat_get_activity(NULL) AS sa
    3. LEFT JOIN pg_authid ad ON(sa.usesysid = ad.oid)WHERE sa.application_name <> 'JobScheduler';
    4. sid | serial# | username
    5. -----------------+---------+----------
    6. 140131025549072 | 0 | omm
    7. 140131071678224 | 0 | omm
    8. 140131125774096 | 0 |
    9. 140131127875344 | 0 |
    10. 140131094742800 | 0 |
    11. (8 rows)
    12. openGauss=# ALTER SYSTEM KILL SESSION '140131075880720,0' IMMEDIATE;