i have a situation that i don't know if it is normal, i think not.

I have several idle connections with the query SET bytea_output='escape', so i arrive to max_connections and have issues with my applications, why are there so many connections idle with that query?


1 Answer 1


Many libraries which manage connections for you will execute some housekeeping queries on the new connection before returning it to the caller. SET bytea_output='escape' is just the type of housekeeping query you might expect to see.

So the likely explanation is that someone keeps asking for a new connections, and then immediately forgets about it without either using it or closing it. To figure out who, you should be looking at other fields of "pg_stat_activity", like usename, application_name, and client_addr.

And ultimately if you don't know who is connecting to your database, you should be changing the passwords or other authentication methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.