Re: How to cancel a query if SIGINT does not work?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Witney <awitney(at)sgul(dot)ac(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to cancel a query if SIGINT does not work?
Date: 2005-08-19 17:08:11
Message-ID: 25987.1124471291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adam Witney <awitney(at)sgul(dot)ac(dot)uk> writes:
> On 19/8/05 5:27 pm, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> In theory that should always work. What PG version is this? Can you
>> attach to the stuck backend with gdb and get a stack trace?

> Am not particularly familiar with gdb, but if you tell me the steps I will
> do it and report back

Think I've posted this before, but:

Determine PID of backend you are interested in, eg with ps

As postgres user, do
$ gdb /path/to/postgres-executable PID-of-process
gdb prints a bunch of junk
gdb> bt
... copy and paste the output given here ...
gdb> quit
gdb: ok to detach? y
$

If you get a pile of purely numeric output from bt, it's useless
(means you're running symbol-stripped executables). I'm hoping
for at least some function names.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Witney 2005-08-19 17:10:28 Re: How to cancel a query if SIGINT does not work?
Previous Message Tom Lane 2005-08-19 17:02:16 Re: total db lockup