Cancelling a query from Python - Mailing list psycopg

From Daniele Varrazzo
Subject Cancelling a query from Python
Date
Msg-id CA+mi_8bpm6u0qwe-h=Zpo2ZF=eo52ij5tijuR1grsCgpJA+ocQ@mail.gmail.com
Whole thread Raw
List psycopg
As you may have experienced, cancelling a long running query from
Python is not easy: ctrl-c doesn't work and it usually takes a
pg_cancel_backend from another connection.

After a request in the bug tracking, here is a recipe to allow queries
to be stopped by a ctrl-c in interactive sessions.

http://initd.org/psycopg/articles/2014/07/20/cancelling-postgresql-statements-python/

Hope it helps.

-- Daniele


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Psycopg2 unable to timeout
Next
From: Damian Dimmich
Date:
Subject: JSONB marshalling