Re: Deleting idle connections - Mailing list pgsql-general

From David G. Johnston
Subject Re: Deleting idle connections
Date
Msg-id CAKFQuwabejBgxy0R3715SuuT0V+dK7_VPUKUcw0eznN8HtCFPw@mail.gmail.com
Whole thread Raw
In response to Deleting idle connections  (Yongye Serkfem <yserkfem@gmail.com>)
List pgsql-general
On Mon, Feb 24, 2025 at 3:50 PM Yongye Serkfem <yserkfem@gmail.com> wrote:

I am having a series of idle connections and unable to delete them with a single command. Any help in realizing this would be greatly appreciated.


"deleting" really isn't the word used to describe this, terminate, kill, or disconnect would be better choices.

You should be able to just use pg_terminate_backend in a select query to accomplish your goal.


Though usually you are better off fixing the problem at the source; or use something like pgbouncer.

David J.

pgsql-general by date:

Previous
From: Yongye Serkfem
Date:
Subject: Deleting idle connections
Next
From: Ron Johnson
Date:
Subject: Re: Deleting idle connections