The connections were created 2 days before. Can I kill the process manually by using the below query?
select pg_terminate_backend(procpid)
from pg_stat_activity
where datname = 'mydb'
and procpid <> pg_backend_pid()
and current_query = '<IDLE>'
and query_start < now() - INTERVAL '2880' MINUTE;