Re: [sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread Mike Bayer
Postgresql session isolation is playing tricks on you. go to psql and do the query from your commandline, and you will see all connections listed. in your program, you can get it to "see" connections that were made after the scope of the current-checked-out-connection started like this: from

Re: [sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread Soumaya Mauthoor
Hello Mike Thanks for quick response as always :-) So I understand setting AUTOCOMMIT has no impact on the number of 'IDLE' connections and will look for different culprit. About the single row in pg_stat_activity, I was actually running the query below, but sent you the shortened version because

Re: [sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread Mike Bayer
On Sat, May 8, 2021, at 11:05 AM, Mike Bayer wrote: > >> ** >> I was wondering if: >> 1. There was a reason for this difference in behaviour? Should a checked-in >> connection show up as 'IDLE'? > > I would check your methodology of measurement because that's not the expected > result and it

Re: [sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread Mike Bayer
On Sat, May 8, 2021, at 10:34 AM, sumau wrote: > Hello > > Our postgreSQL database is suffering from too many IDLE connections and I'm > wondering if this has to do with isolation level which we usually set to > AUTOCOMMIT. that's not really possible as AUTOCOMMIT "isolation" merely means tha

[sqlalchemy] Re: IDLE vs checked in connection

2021-05-08 Thread sumau
Hello Our postgreSQL database is suffering from too many IDLE connections and I'm wondering if this has to do with isolation level which we usually set to AUTOCOMMIT. When I use the default connection settings then checked-in connections do not appear as IDLE in postgres: engine = create_engi

[sqlalchemy] IDLE vs checked in connection

2021-05-08 Thread sumau
Hello Our postgreSQL database is suffering from too many IDLE connections and I'm wondering if this has to do with isolation level which we usually set to AUTOCOMMIT. When I use the default connection settings then checked-in connections do not appear as IDLE in postgres: engine = create_engi