I'm in a situation where I have many connections that are "IDLE in transaction". I spotted them myself. I could kill them, but that wouldn't prevent them from happening again. In fact, it happens regularily.
Is there a way to get the list of SQL statements that were previously executed as part of a given transaction?
If I could get that, it would be a hell lot easier to figure out the misbehaving client.