pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Quit currently running query
Date: Tue, 28 Feb 2023 07:42:08 -0600
Message-ID: <c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com> (raw)
In-Reply-To: <CAHGzHmTqMBdE-M4tbffG_eFD0W_rH_fDgmzbYQ+oLOsvQynYkg@mail.gmail.com>
References: <CAHGzHmTqMBdE-M4tbffG_eFD0W_rH_fDgmzbYQ+oLOsvQynYkg@mail.gmail.com>

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.

view thread (6+ messages)  latest in thread

Message-ID: <c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com>
Permalink:  ../c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com/
Also on:    postgresql.org/message-id/c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Quit currently running query
  In-Reply-To: <c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com>
  References: <CAHGzHmTqMBdE-M4tbffG_eFD0W_rH_fDgmzbYQ+oLOsvQynYkg@mail.gmail.com> <c85d3f88-96db-c4cb-f2a9-33ee4cc71266@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox