Cancelling Queries
Cancelling Queries
От:
Mark Mitchell <mark@lapcrew.com>
Дата:
I have a Perl program that executes PostgreSQL queries through DBI. Is there any way to cancel a query once its started. If I could at least somehow get the PID of the child process postmaster starts I could kill that. This may be a better question for the Perl programming list but I thought I'd ask you guys too Mark Mitchell
Re: Cancelling Queries
От:
jasiek@klaster.net
Дата:
On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote: > I have a Perl program that executes PostgreSQL queries through DBI. > Is there any way to cancel a query once its started. If I could at least > somehow get the PID of the child process postmaster starts I could kill > that. > > This may be a better question for the Perl programming list but I > thought I'd ask you guys too > > Mark Mitchell Use transactions. Just before query finish you can confirm query (commit) or cancel it (rollback) Regards, Tomasz Myrta
Re: Cancelling Queries
От:
Mark Mitchell <mark@lapcrew.com>
Дата:
These are select queries that may have been keyed incorrectly that I need to cancel. So a transaction won't help in this case.
- Mark
jasiek@klaster.net wrote:On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote:I have a Perl program that executes PostgreSQL queries through DBI. Is there any way to cancel a query once its started. If I could at least somehow get the PID of the child process postmaster starts I could kill that. This may be a better question for the Perl programming list but I thought I'd ask you guys too Mark MitchellUse transactions. Just before query finish you can confirm query (commit) or cancel it (rollback) Regards, Tomasz Myrta ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org-- Mark Mitchell www.lapcrew.com Registered Linux User # 299662 Mandrake 8.0 , RedHat 8.0
Re: Cancelling Queries
От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Libpq has PQrequestCancel() which does cancels, but I don't see it in DBD. Maybe someone can make a patch. ;-) --------------------------------------------------------------------------- jasiek@klaster.net wrote: > On Thu, Mar 06, 2003 at 06:25:29PM -0500, Mark Mitchell wrote: > > I have a Perl program that executes PostgreSQL queries through DBI. > > Is there any way to cancel a query once its started. If I could at least > > somehow get the PID of the child process postmaster starts I could kill > > that. > > > > This may be a better question for the Perl programming list but I > > thought I'd ask you guys too > > > > Mark Mitchell > Use transactions. > Just before query finish you can confirm query (commit) or cancel it > (rollback) > > Regards, > Tomasz Myrta > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Re: Cancelling Queries
От:
jasiek@klaster.net
Дата:
On Thu, Mar 06, 2003 at 08:31:56AM -0600, Mark Mitchell wrote: > These are select queries that may have been keyed incorrectly that I > need to cancel. So a transaction won't help in this case. What about setting maximum query execution time in postgresql configuration? There are some options helpful for deadlock cases. Regards, Tomasz Myrta