Re: ctrl-c - is it safe to kill a query?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Mark Steben <msteben(at)autorevenue(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: ctrl-c - is it safe to kill a query?
Date: 2010-02-08 22:49:06
Message-ID: 201002082249.o18Mn6V20472@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mark Steben wrote:
> Hi folks,
>
>
>
> We are running psql 8.3.7 and linux 2.6.9-78.0.17.ELsmp
>
>
>
> We had a situation this weekend where someone was running an update
>
> On the psql command line and had to kill it.
>
>
>
> It is considered 'best practice' to use cntrl-c to do so?
>
> Or is there a better way? The transaction did roll back.

Sure, that is fine. It doesn't hurt anything. There is also a way to
do it from another session using using pg_cancel_backend().

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Marc Fromm 2010-02-08 23:38:11 copy table
Previous Message Rosser Schwarz 2010-02-08 22:38:54 Re: Best Replication Tool