On 23/09/2010 12:26 AM, Atul.Goel@xxxxxxxxxxxxxxxxxxx wrote:
Hi All,
I by mistake ran a query to update a huge table with around 500000 rows
and has to kill the session.
I found the process-id from the query select * from pg_stat_activity.
I killed the process using Kill -9 process_id.
Why kill -9 (SIGKILL)?
Did it not respond to regular SIGTERM (the default for kill) ?
SIGKILL will forcibly terminate a process, with no chance for the
process to flush any half-written buffers, tell other processes it is
being killed, etc. In a system of co-operating processes like the
PostgreSQL server, this is bad.
As per the manual, you should not "kill -9" a backend.
For that matter, you should not as a sysadmin "kill -9" (SIGKILL) any
process at all, unless it fails to respond to SIGTERM after a few
seconds (or longer) and letting it finish whatever it's doing isn't an
option. SIGKILL is a really big hammer.
--
Craig Ringer
Tech-related writing at http://soapyfrogs.blogspot.com/
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general