rajan schrieb am 18.11.2016 um 12:56:
> If the _session_ is idle then shouldn't it be removed from pg_stat_activity?
The session is only removed from pg_stat_activity when it's closed, i.e. when the client disconnects.
Being "idle" and disconnecting are two completely different things