Kill session in PostgreSQL

Started by Ashish Karalkaralmost 19 years ago4 messagesgeneral
Jump to latest
#1Ashish Karalkar
ashish_postgre@yahoo.co.in

Hello all,
is there any command just like ORACLE Uses kill session to kill a particular session .
tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill?

Thanks in advance

With Regards
ashish

---------------------------------
Check out what you're missing if you're not on Yahoo! Messenger

#2Ardian Xharra
axharra@boxxo.info
In reply to: Ashish Karalkar (#1)
Re: Kill session in PostgreSQL

You can use kill PID
----- Original Message -----
From: Ashish Karalkar
To: pggeneral
Sent: Tuesday, April 10, 2007 8:01 AM
Subject: [GENERAL] Kill session in PostgreSQL

Hello all,
is there any command just like ORACLE Uses kill session to kill a particular session .
tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill?

Thanks in advance

With Regards
ashish

------------------------------------------------------------------------------
Check out what you're missing if you're not on Yahoo! Messenger

------------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.0.0/754 - Release Date: 09/04/2007 22:59

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: Ashish Karalkar (#1)
Re: Kill session in PostgreSQL

On Tue, Apr 10, 2007 at 01:01:30PM +0100, Ashish Karalkar wrote:

Hello all,
is there any command just like ORACLE Uses kill session to kill a particular session .
tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill?

Uhh, yeah. Kill -9 is bad. The documentation talks about signals but in
general you can use kill -INT to abort a query.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#4Magnus Hagander
magnus@hagander.net
In reply to: Ardian Xharra (#2)
Re: Kill session in PostgreSQL

Beware that this is not a supported method, though. It often works, but
don't make it a part of your regular maintenance.

What you can do is use pg_cancel_query() to kick the session back out to
IDLE - that's fully suported, and it will drop any locks the process has,
so it shuold get rid of most of your problem.

//Magnus

Show quoted text

On Tue, Apr 10, 2007 at 08:46:20AM -0400, Ardian Xharra wrote:

You can use kill PID
----- Original Message -----
From: Ashish Karalkar
To: pggeneral
Sent: Tuesday, April 10, 2007 8:01 AM
Subject: [GENERAL] Kill session in PostgreSQL

Hello all,
is there any command just like ORACLE Uses kill session to kill a particular session .
tried withh linux kill -9 PID but it also kills all other sessions or am I just giving wrong signal to command kill?

Thanks in advance

With Regards
ashish

------------------------------------------------------------------------------
Check out what you're missing if you're not on Yahoo! Messenger

------------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.0.0/754 - Release Date: 09/04/2007 22:59