Re: (Never?) Kill Postmaster?

From: "Michael Harris" <michael(dot)harris(at)ericsson(dot)com>
To: "Stefan Schwarzer" <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: (Never?) Kill Postmaster?
Date: 2007-10-24 07:06:38
Message-ID: E5F4C5A18CAB7A4DA23080DE9CE8158604F8B27A@eaubrmw001.eapac.ericsson.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

First you need to identify the correct postgresql process. Postgresql
spawns an individual server process for each database connection. They
look something like this:

postgres 27296 7089 9 08:00 ? 00:05:52 postgres: username
databasename [local] idle

If a query was running then it would say 'SELECT' instead of 'idle'.

You can send a SIGINT (ie, -2) to that process to cancel a query, eg

kill -2 27296

In most systems SIGINT is the default for kill so you could just do kill
<pid>.

The tip is ''kill -9' the postmaster', which has two important
differences to the scenario I just described:

1) kill -9 means the OS kills the process without allowing it to clean
up after itself

2) The postmaster is the master postgresql backend process. If you want
to kill a single query you would not want to kill that.

Regards // Mike

________________________________

From: Stefan Schwarzer [mailto:stefan(dot)schwarzer(at)grid(dot)unep(dot)ch]
Sent: Wednesday, 24 October 2007 3:58 PM
To: pgsql-general(at)postgresql(dot)org
Subject: (Never?) Kill Postmaster?

Hi there,

I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"...

Now, what am I supposed to do if I launched a query which takes ages,
and which I want to interrupt?

Thanks for any advice,

Stef

____________________________________________________________________

Stefan Schwarzer

Lean Back and Relax - Enjoy some Nature Photography:

http://photoblog.la-famille-schwarzer.de

Appetite for Global Data? UNEP GEO Data Portal:

http://geodata.grid.unep.ch

____________________________________________________________________

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-10-24 07:12:27 Re: Start DB giving fatal message.(linux)
Previous Message Albe Laurenz 2007-10-24 07:05:33 Re: can't compile Pl/Java