Re: "<IDLE> in transaction" can't be killed with pg_cancel_backend(). Is it a bug?

From: Bryce Nesbitt <bryce2(at)obviously(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Subject: Re: "<IDLE> in transaction" can't be killed with pg_cancel_backend(). Is it a bug?
Date: 2011-01-04 22:47:41
Message-ID: 4D23A38D.1010700@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Michael Glaesemann wrote:
> On Jan 4, 2011, at 17:29, Bryce Nesbitt wrote:
>
>> Should I expect pg_cancel_backend() to work in a case like this? If not does this sound like a reportable bug?
>>
> pg_cancel_backend() cancels the running query for that backend. In the case of<IDLE>, there is no running query for that backend.
>
> Likely you're looking for pg_terminate_backend().
> Michael Glaesemann
> grzm seespotcode net
>
Hmm, yes. Though it seems to not be in the documentation, or, for that
matter, the current code:

utils/adt/misc.c

#*ifdef* NOT_USED

//* Disabled in 8.0 due to reliability concerns; FIXME someday *//
*pg_terminate_backend*(PG_FUNCTION_ARGS

# select pg_terminate_backend(5);
ERROR: function pg_terminate_backend(integer) does not exist
LINE 1: select pg_terminate_backend(5);
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message bricklen 2011-01-04 23:03:48 Re: "<IDLE> in transaction" can't be killed with pg_cancel_backend(). Is it a bug?
Previous Message Michael Glaesemann 2011-01-04 22:32:43 Re: "<IDLE> in transaction" can't be killed with pg_cancel_backend(). Is it a bug?