PostgreSQL - Aborting a Query
If necessary, you can contact the DSA sysadmin for assistance in the Jupyter_environment channel on Teams. Or you can try the following:
- On the same server that the problem query was run on, open a new notebook or terminal
- Connect and run: SELECT pid, usename, query_start, query FROM pg_stat_activity WHERE state = 'active' and pid <> pg_backend_pid(); This will list the active sessions with the query that was run, excluding this query itself.
- Get the pid of the session for the query you want to abort.
- Run: SELECT pg_cancel_backend(pid); with the pid from step 3.
Need more information or help? Reach out to us at 📧 jcwdw@missouri.edu