Created
December 17, 2014 01:40
-
-
Save yujihamaguchi/43f0fca95c15b33e4922 to your computer and use it in GitHub Desktop.
[Redshift] ロックを検出、プロセスの停止
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
select current_time, c.relname, l.database, l.transaction, l.pid, a.usename, l.mode, l.granted from pg_catalog.pg_locks l join pg_catalog.pg_class c on c.oid = l.relation join pg_catalog.pg_stat_activity a on a.procpid = l.pid; | |
set query_group to 'superuser'; | |
select pg_terminate_backend(<pid>); | |
reset query_group; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment