Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select -- pg_cancel_backend(pid),
- -- pg_terminate_backend(pid),
- pid,
- datname As database,
- usename As username,
- -- regexp_replace(text(client_addr),'/.*','')||':'||client_port As address,
- client_addr As address,
- application_name As application,
- state,
- concat(wait_event,' ('||wait_event_type||')') As wait,
- to_char(query_start,'dd.mm.yyyy hh24:mi:ss') As start,
- cast(extract(epoch from (clock_timestamp()-query_start)) As numeric(18,3)) As duration,
- translate(query,chr(7)||chr(10)||chr(13),' ') As query
- From pg_stat_activity
- Where pid<>pg_backend_pid() And
- -- client_addr='81.24.120.102' And
- -- client_addr='192.168.90.35' And
- -- client_addr='192.168.33.138' And
- -- client_addr In ('192.168.90.35','192.168.33.138') And
- -- client_addr='172.17.4.201' And
- state='active' And -- pid=34414 and
- -- state Like 'idle in transaction%' And
- -- coalesce(application_name,'')<>'Navicat' And
- -- coalesce(application_name,'') Not Like 'pgAdmin%' And
- -- coalesce(application_name,'')='PostgreSQL JDBC Driver' And
- -- usename='gpospb' And
- -- usename='pentaho' And
- -- datname='pentaho' And
- -- datname='contest' And
- -- lower(query) Like '%select %stat%' And
- -- lower(query) Like '%select %lot%' And
- true ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement