Re: How to stop query execution from Python/pyPgS QL

Aaron Held <[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
I created a hack in my app that may not be appropriate for you but....

I made an process monitor that used an activity view (I forgot the 
details, but its in PG docs somewhere under Monitoring) to deterimine 
the PID of the backend and then kill it from the python using the 
command like kill the errant PID .

I wonder if the MySQL functionality is due to the client or the server?
I often run queries from various PG tools that run away.

-Aaron




Murthy Kambhampaty wrote:
> Aaron, thanks for the reply. I have been doing that, but I have several
> Windows users and I was hoping to avoid having to (1) show them how and (2)
> give them privileges. I guess I will, for now. Is there any chance that
> pyPgSQL will use the libpq function "PGrequestCancel" to support killing
> queries by closing Python is a manner similar to issuing ^C in psql?
> 
> Thanks,
> 	Murthy
> 
> PS: We actually submit Python code from SciTE which opens a new Python for
> each "Tools->Go" action. The SciTE "Tools->Stop Query Execution" action
> tries to get Python to interrupt execution and close. In MySQL-DB this would
> cancel the query, but it doesn't in with pyPgSQL. The main advantage to
> doing this from SciTE is that the script is executed in a separate
> window/thread and does not lock the editor; slick!
> 
> -----Original Message-----
> From: Aaron Held [mailto:[email protected]]
> Sent: Thursday, December 12, 2002 11:53
> To: Murthy Kambhampaty
> Subject: Re: [Pypgsql-users] How to stop query execution from
> Python/pyPgSQL
> 
> 
> You can kill the backend pid
> 
> ps -ax | grep post
> 
> -Aaron
> 
> Murthy Kambhampaty wrote:
> 
>>Is there a way to stop a query submitted with cx.query() or cur.execute()
>>using pyPgSQL on Windows? Killing the python shell does not seem to do it.
>>
>>Thanks,
>>	Murthy
>>
>>
>>-------------------------------------------------------
>>This sf.net email is sponsored by:
>>With Great Power, Comes Great Responsibility 
>>Learn to use your power at OSDN's High Performance Computing Channel
>>http://hpc.devchannel.org/
>>_______________________________________________
>>Pypgsql-users mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/pypgsql-users
> 




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.