- Aug 9, 2022
- 23
- 3
- 3
- Customer Identifier
- E114627
For understanding why the PostgreSQL client license count may be exceeded, it is important to understand what an active connection is from the perspective of the PostgreSQL server:
References:
- A client application that opens a connection but does not disconnect
- A client application that opens a connection but fails to disconnect when it terminates. In this case, the connection remains active until the idle session timeout configured for the PostgreSQL server elapses
- A client application that is hung or terminates due to a runtime error and hence never disconnects. In both cases, the aforementioned idle timeout determines when the connection is freed by the server
- Your application disconnects at the earliest possible time
- All connections are disconnected before the process terminates
- The PostgreSQL idle_session_timeout configuration setting is set to a meaningful value in postgresql.conf.
Note: this setting is 0 by default, which means sessions are kept alive indefinitely!
SQL:
select count(*) used from pg_stat_activity where state='active'
References:
- Information on the idle_session_timeout setting: https://www.postgresql.org/docs/16/runtime-config-client.html#GUC-IDLE-SESSION-TIMEOUT
Last edited by a moderator: