Re: [GENERAL] how to cancel a request in progress ?
On Tue, 25 May 1999, Jonathan Davis wrote:
hello all
is this possible to cancel a request in progress ?
If you are using the interactive monitor, psql, try ctrl-c.
If you are using the libpq or other interface, then it becomes much more
application specific, i.e. you might have to kill off the app.
Simon.
--
"The world will end at Dec 31 1999 23:59:59. Please save your work and log
off before then or risk losing your data."
Simon Drabble Somewhere in cyberspace
simond@foxlink.net
Import Notes
Reply to msg id not found: 374AD402.36D5F337@idianet.net
On Tue, 25 May 1999, Jonathan Davis wrote:
Simon Drabble wrote:
On Tue, 25 May 1999, Jonathan Davis wrote:
hello all
is this possible to cancel a request in progress ?
If you are using the interactive monitor, psql, try ctrl-c.
If you are using the libpq or other interface, then it becomes much more
application specific, i.e. you might have to kill off the app.but how do you kill a request in progress?
I 'm using the libpq,.
Kill it off without killing the ap you mean? Unless your app is multi-threaded
or multi-process and uses IPC, you might not be able to.
You can use the asynch access functions within libpq, which will give control
back to your program. If you then decide at a later point that the database
command has not returned, you can kill it off if it is within a subthread or
subprocess (from a fork(), e.g.) but AFAIK there is no libpq or postgres
function to terminate a running command.
Actually it might be a better idea have your subprocess handle the db request
synchronously, and then the parent can time it out if it takes too long and
send a signal to the child to terminate it. This could be quite messy,
however, so if you are doing inserts or anything which affects a table's
contents, I would wrap it in a BEGIN..END transaction.
Simon.
--
"The world will end at Dec 31 1999 23:59:59. Please save your work and log
off before then or risk losing your data."
Simon Drabble Somewhere in cyberspace
simond@foxlink.net
Import Notes
Reply to msg id not found: 374AE035.86C43554@idianet.net | Resolved by subject fallback
On Tue, 25 May 1999, Jonathan Davis wrote:
Jonathan Davis wrote:
Simon Drabble wrote:
On Tue, 25 May 1999, Jonathan Davis wrote:
hello all
is this possible to cancel a request in progress ?
If you are using the interactive monitor, psql, try ctrl-c.
If you are using the libpq or other interface, then it becomes much more
application specific, i.e. you might have to kill off the app.but how do you kill a request in progress?
Simon.
I 'm using the libpq,.
it is possible by : PQrequestCancel but you must use the Asynchronous
Query Processing
(PQsendQuery/PQgetResult).
--
"The world will end at Dec 31 1999 23:59:59. Please save your work and log
off before then or risk losing your data."
Simon Drabble Somewhere in cyberspace
simond@foxlink.net
Import Notes
Reply to msg id not found: 374AE554.D56E0859@idianet.net | Resolved by subject fallback
It isn't pretty, but as 'su' or 'postgres' you can kill the the "postmaster pid".
However, you may have to clean up 'junk files' left in the data base. Don't do
this except as a last resort.
mike
--
-------------------------------------------------------
It said use Windows 95 or better, so I installed Linux!
--
Dr Michael A. Koerber
MIT/Lincoln Laboratory
781-981-3250
-------------------------------------------------------
On Tue, 24 May 1999, Michael A. Koerber wrote:
It isn't pretty, but as 'su' or 'postgres' you can kill the the "postmaster pid".
However, you may have to clean up 'junk files' left in the data base. Don't do
this except as a last resort.mike
--
-------------------------------------------------------
It said use Windows 95 or better, so I installed Linux!
--
Dr Michael A. Koerber
MIT/Lincoln Laboratory
781-981-3250
-------------------------------------------------------
Hmmm. Sledgehammer, this is nut. Nut, meet sledgehammer. :)
Jonathan found the optimal solution - PQrequestCancel() from within the app.
Simon.
--
"The world will end at Dec 31 1999 23:59:59. Please save your work and log
off before then or risk losing your data."
Simon Drabble Somewhere in cyberspace
simond@foxlink.net
Simon Drabble wrote:
On Tue, 25 May 1999, Jonathan Davis wrote:
hello all
is this possible to cancel a request in progress ?
If you are using the interactive monitor, psql, try ctrl-c.
If you are using the libpq or other interface, then it becomes much more
application specific, i.e. you might have to kill off the app.
but how do you kill a request in progress?
Simon.
I 'm using the libpq,.
Jonathan Davis wrote:
Simon Drabble wrote:
On Tue, 25 May 1999, Jonathan Davis wrote:
hello all
is this possible to cancel a request in progress ?
If you are using the interactive monitor, psql, try ctrl-c.
If you are using the libpq or other interface, then it becomes much more
application specific, i.e. you might have to kill off the app.but how do you kill a request in progress?
Simon.
I 'm using the libpq,.
it is possible by : PQrequestCancel but you must use the Asynchronous
Query Processing
(PQsendQuery/PQgetResult).