I am running PSQL with PostGis extension. After the start of server, after about 3 weeks, I start getting fatal errors for connections with "too many clients already". When I restart the server, problem is gone, but is back again after aprox. 3 weeks.
If I run
pg_stat_activity, I got
SELECT state, count(*) FROM pg_stat_activity GROUP BY state; "active";2 "idle";944
And all idle queries are the same - SELECTs.
I cannot debug this problem and restarting server all over is not a real solution.