Re: Quit currently running query

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Quit currently running query
Date: 2023-02-28 13:42:08
Message-ID: c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/28/23 04:53, Albert Cornelius wrote:
> How can I quit a currently running query? I've issued a query and my
> server does not respond anymore. Is there another solution than using kill -9?

What *specifically* do you mean by "my server does not respond anymore"? 
Because if "the server" /really/ doesn't respond anymore, you can't even
issue "kill -9".

I'd first try "|select pg_cancel_backend(<pid>);".  If that doesn't work,
try |"|select pg_*terminate*_backend(<pid>);"|||, which is the
Postgresql-aproved version of "kill -9".

--
Born in Arizona, moved to Babylonia.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message celati Laurent 2023-02-28 14:39:16 Move all elements toward another schema?
Previous Message Ian Lawrence Barwick 2023-02-28 13:41:42 Re: Quit currently running query