Postgres: locating session information

Locating session information



--not my pid
select pid , usename, application_name, client_addr, client_hostname, query, state from pg_stat_activity where pid <> pg_backend_pid();

select pid , usename, application_name, client_addr, client_hostname, query, state from pg_stat_activity where pid = ##### ;

select  pid , usename, application_name, client_addr,  client_hostname, query, state from pg_stat_activity where datname='postgres';


To kill session


select pg_terminate_pid(xxxx);

select pg_cancel_pid(xxxx);








No comments:

Post a Comment