Long running READ queries stuck in "idle in transaction"
idle in transaction means the connection is not doing anything - it's "idle". 

The query has finished, if the query was still running the connection would be shown as active. 

The code that initiated the query, forgot to end the transaction by calling commit or rollback. If a connections stays in "idle in transaction" for a long time, this is typically a bug in the application. 

Make sure your application properly ends every transaction - even "read-only" ones that only run SELECT statements. Or switch your connection to auto-commit in your code.