🤖 Backend
PostgreSQL
Kill Existing Processes or Transactions

Kill Existing Processes or Transactions

How to

  1. Check existing process PID
SELECT * FROM pg_stat_activity;
  1. Find the process you want to kill, then type:
SELECT pg_cancel_backend(<pid of the process>)

or force kill (terminate) within

SELECT pg_terminate_backend(<pid of the process>)

References

Stackoverflow (opens in a new tab)