Re: Auto close idle connections for specific user (not by pg_cancel command) - Mailing list pgsql-general

From Thomas Poty
Subject Re: Auto close idle connections for specific user (not by pg_cancel command)
Date
Msg-id CAN_ctnivmJ3J-mR_br7Ni6M7W4L0t1jsj7kXqX0szrDpqYMm5g@mail.gmail.com
Whole thread Raw
In response to Re: Auto close idle connections for specific user (not by pg_cancel command)  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Auto close idle connections for specific user (not by pg_cancel command)  (Thomas Poty <thomas.poty@gmail.com>)
List pgsql-general
Hi,
Maybe pgterminator could help you
Regards 
Thomas 

Le mar. 5 févr. 2019 à 18:52, Pavel Stehule <pavel.stehule@gmail.com> a écrit :
Hi


út 5. 2. 2019 v 18:47 odesílatel Emi <emilu@encs.concordia.ca> napsal:
Hello,
 
In psql, may I know is there a way/config that idle connections could be auto closed (but not by
pg_cancel_backend command) for specific user(s) please?

For example, 
select  usename, waiting, query_start  from pg_stat_activity 
where usename like 'connUser1' and
           current_query='<IDLE>';

All connections from connUser1, if idle more than 1 day, psql auto close them.

What I know, there is not any timeout for this purpose.

Maybe pgbouncer can do this https://pgbouncer.github.io/config.html

client_idle_timeout

Regards

Pavel

Thanks a lot.

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Auto close idle connections for specific user (not by pg_cancel command)
Next
From: Thomas Poty
Date:
Subject: Re: Auto close idle connections for specific user (not by pg_cancel command)