this query was executed three days before and remains unclosed.
We are using unixODBC driver and enabled connection pooling for 5mins. I'm not sure whether this causing any problem.
Usually this is an application bug, not PostgreSQL's. If you wish for help diagnosing posting to -general, with considerably more detail if not an actual self-contained test case, is appreciated. Given that you are programming with the ODBC driver an even more appropriate list would be pgsql-odbc@postgresql.org as noted here : https://odbc.postgresql.org/