<IDLE> in transaction - safest way to kill

Started by William Temperleyover 17 years ago4 messagesgeneral
Jump to latest
#1William Temperley
willtemperley@gmail.com

Hi all

Could anyone tell me what's the best thing to with idle transactions
that are holding locks?

I just killed the process as I wanted to get on with some work. I'm
just not sure this is a good idea when we go into production.

Cheers

Will T

#2Glyn Astill
glynastill@yahoo.co.uk
In reply to: William Temperley (#1)
Re: <IDLE> in transaction - safest way to kill

select pg_cancel_backend(<pid>);

--- On Fri, 5/12/08, William Temperley <willtemperley@gmail.com> wrote:
Show quoted text

From: William Temperley <willtemperley@gmail.com>
Subject: [GENERAL] <IDLE> in transaction - safest way to kill
To: pgsql-general@postgresql.org
Date: Friday, 5 December, 2008, 2:08 PM
Hi all

Could anyone tell me what's the best thing to with idle
transactions
that are holding locks?

I just killed the process as I wanted to get on with some
work. I'm
just not sure this is a good idea when we go into
production.

Cheers

Will T

--
Sent via pgsql-general mailing list
(pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3William Temperley
willtemperley@gmail.com
In reply to: Glyn Astill (#2)
Re: <IDLE> in transaction - safest way to kill

Could anyone tell me what's the best thing to with idle
transactions
that are holding locks?

On Fri, Dec 5, 2008 at 2:25 PM, Glyn Astill <glynastill@yahoo.co.uk> wrote:

select pg_cancel_backend(<pid>);

Thanks. Sorry for the basic question.

Will

#4Fujii Masao
masao.fujii@gmail.com
In reply to: Glyn Astill (#2)
Re: <IDLE> in transaction - safest way to kill

On Fri, Dec 5, 2008 at 11:25 PM, Glyn Astill <glynastill@yahoo.co.uk> wrote:

select pg_cancel_backend(<pid>);

No, pg_cancel_backend() cancels only *query*, and doesn't kill idle
in transaction. I think that killing the backend (idle in transaction) with
SIGTERM is better way.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center