my opinion is my own

Redshiftのクエリキャンセル

PIDの取得

select pid, trim(starttime) as start, duration, trim(user_name) as user,substring (query,1,40) as querytxt 
from stv_recents
where status = 'Running';

PIDのkill

select pg_cancel_backend(16749);

もしくは

cancel 16749;

実行クライアント側にはエラーメッセージが出力される

client 2 aborted in command 16 (SQL) of script 0; ERROR:  Query (570) cancelled on user's request

https://docs.aws.amazon.com/ja_jp/redshift/latest/dg/r_CANCEL.html https://docs.aws.amazon.com/ja_jp/redshift/latest/dg/PG_CANCEL_BACKEND.html

---

関連しているかもしれない記事


#AWS #Redshift