Terminate (kill) specific session on a server

Redshift provides function to terminate specific session on a server.

Find session ID (process)

First we will identify the session we want to end. We do it by listing all sessions on the server with this query:

select * from stv_sessions;


Result shows active sessions on server.

sample results

Kill session

Now we will use process ID (process) to kill the session (323 in our example):

select pg_terminate_backend(323);


Redshift ends session and rolls back all transactions that are associated with it. sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.