Обсуждение: in transaction - safest way to kill

Поиск
Список
Период
Сортировка

in transaction - safest way to kill

От
"William Temperley"
Дата:
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

Re: in transaction - safest way to kill

От
Glyn Astill
Дата:
select pg_cancel_backend(<pid>);


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

> 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




Re: in transaction - safest way to kill

От
"William Temperley"
Дата:
>>
>> 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

Re: in transaction - safest way to kill

От
"Fujii Masao"
Дата:
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