Thread: [BUGS] BUG #14556: Sorry, Too many clients already

[BUGS] BUG #14556: Sorry, Too many clients already

From
naveenallin@gmail.com
Date:
The following bug has been logged on the website:

Bug reference:      14556
Logged by:          Naveen Chalmeti
Email address:      naveenallin@gmail.com
PostgreSQL version: 9.6.1
Operating system:   Ubuntu 14.04 LTS
Description:

We are using postgresql(9.6.1) for more than three months and every
two/three days once we need to restart our servers with an error "Sorry, too
many connections already". Using a script we found that the postgresql
driver query listed below is not getting closed and remain unclosed. 

16384 | SGDatabase | 18953 |       10 | postgres |                  |
127.0.0.1   |                 |       57979 | 2017-02-17
13:27:31.990945+05:30 |                                  | 2017-02-17
13:29:56.433781+05:30 | 2017-02-17 13:29:56.435756+05:30 |                 |
           | idle                |             |              | select
n.nspname, c.relname, a.attname, a.atttypid, t.typname, a.attnum, a.attlen,
a.atttypmod, a.attnotnull, c.relhasrules, c.relkind, c.oid,
pg_get_expr(d.adbin, d.adrelid), case t.typtype when 'd' then t.typbasetype
else 0 end, t.typtypmod, c.relhasoids from (((pg_catalog.pg_class c inner
join pg_catalog.pg_namespace n on n.oid = c.relnamespace and c.oid = 22796)
inner join pg_catalog.pg_attribute a on (not a.attisdropped) and a.attnum >
0 and a.attrelid = c.oid) inner join pg_catalog.pg_type t on t.oid =
a.atttypid) left outer join pg_attrdef d on a.atthasdef and d.adrelid =
a.attrelid and d.adnum = a.attnum order by n.nspname, c.relname, attnum

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. 

Please help us out.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: [BUGS] BUG #14556: Sorry, Too many clients already

From
"David G. Johnston"
Date:
On Mon, Feb 20, 2017 at 1:24 AM, <naveenallin@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14556
Logged by:          Naveen Chalmeti
Email address:      naveenallin@gmail.com
PostgreSQL version: 9.6.1
Operating system:   Ubuntu 14.04 LTS
Description:
​[...]​

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/

David J.