Skip to content

Instantly share code, notes, and snippets.

@yujihamaguchi
Created December 17, 2014 01:40
Show Gist options
  • Save yujihamaguchi/43f0fca95c15b33e4922 to your computer and use it in GitHub Desktop.
Save yujihamaguchi/43f0fca95c15b33e4922 to your computer and use it in GitHub Desktop.
[Redshift] ロックを検出、プロセスの停止
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