SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE query like '%<condition>%' AND (now() - pg_stat_activity.query_start) > interval '5 minutes';
There is two commands to kill query
Soft kill: pg_cancel_backend(pid)
Hard kill pg_terminate_backend(pid)
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from shutil import move | |
translation_table = { | |
"А": "A", | |
"а": "a", | |
"Б": "B", | |
"б": "b", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete first echo for real results | |
for file in *; do echo mv "$file" "$(echo $file | sed 's/ - /_/g ; s/ /-/g')" ; done |
OlderNewer