CANCEL QUERY

Introduction

CANCEL QUERY: Cancel a backend’s current query.

Synopsis

SELECT pg_cancel_backend(pid);

Examples

Here is the steps to cancel query in Hologres:

  1. Find the pid of the running query that you are about to cancel:
SELECT pid,query FROM pg_stat_activity WHERE length(query) > 0;

2.Cancel the query using the identified pid

SELECT pg_cancel_backend(192910);