I can't close connections on the application side. How I close connections
on the database side? With pg_terminate_backend, pg_cancel_backend or exists
other function? I didn't want terminate backends because all connections
state was active.
I refer only to "idle" because almost in every database that I've saw the
application doesn't close correctly the connections. If are "idle in
transaction" is not normal.
If you have lots of permanently maintained client sessions and cannot change the client behavior you either need to try and get transaction pooling working in a proxy pooling layer and point that clients to that OR increase the number of simultaneous sessions your server will allow to some number larger than the maximum possible concurrently connected clients. And hope the server can handle the extra load.
David J.