How can I cancel a query?

I’d like to cancel a query but am not sure how to do this.

To cancel a query, you’ll have to run some SQL. The process involves two steps: (1) find the query of interest (2) cancel it.

  1. Look at the special STV_INFLIGHT Redshift table and grab the Process ID (in the pid column) associated with the query you’re interested in.

  2. Cancel the query using this pid by running CANCEL <your pid here>. For more detail, see the Redshift documentation on canceling a query.