Cancel a query.

From: Rob Brown-Bayliss <r(dot)brown(dot)bayliss(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Cancel a query.
Date: 2010-11-20 05:41:29
Message-ID: AANLkTimfAah_TDMLfcOJ2R0T1FmUhb43f0tf3R8Zkhn=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I have some code using psycopg in python. Connecting in async mode.

I am trying to catch time outs etc, basically after a set amount of
time I am assuming something has failed.

I then want to use "select pg_cancel_backend(15209);" to cancel the
query. But I can't unless I am connected as the postgres super user.

How can I get my app to cancel one of it's own queries while logged on
as a normal user?

Thanks.

--

Rob

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grant Mckenzie 2010-11-20 06:00:23 newbie question - delete before insert
Previous Message Adrian Klaver 2010-11-20 03:03:06 Re: Upgrading 8.2 to 8.4: pg_restore: did not find magic string in file header\n