[IPython-User] Ctrl-C to kill queries in iPython
Mon Nov 28 11:17:32 CST 2011
On 28 November 2011 15:43, Dave Himrod <firstname.lastname@example.org> wrote:
> I wrote a database/connection wrapper that can connect to different types
> of databases (mysql, netezza, vertica and mysql). A problem we have is
> that hitting ctrl-c does not necessarily kill the query, sometimes the
> ctrl-c interrupt isn't even handled until the query returns. Does anyone
> have any experience with this? How can I handle the sigint to stop the
> query? Is there a generic way for me to tell the databases to kill the
> queries on their end as well so it does not go zombie, I am hoping it is
> not specific to each db and is part of the pyodbc or mysqldb packages?
Is this only a problem in IPython? Have you tried Ctrl-C when a query is
running from a standard Python interpreter?
I haven't done much database programming, but I expect that each database
might need a specific command to kill the query. E.g. a quick search turned
up this for MySQL: http://price.mit.edu/blog/2010/06/killing-a-mysql-query/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User