Getting the connection pid for running queries #614
runitrupam
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have to kill certain running db queries which are no longer needed.
Connectorx uses the connection_string() not the psycopg2 connection.
cx.read_sql("postgresql://username:password@server:port/database", "SELECT * FROM lineitem")
So is there a way to get the pid that will be used for this query execution?
Note:- 1. some of my queries take 3-4 mins. I need a way to kill these running queries.
2. The same queries can be run by diff. users, but I need to kill the query that was run by me.
Use Case:- Kill db queries if API is canceled.
Beta Was this translation helpful? Give feedback.
All reactions