Re: Clients disconnect but query still runs - Mailing list pgsql-general

From Nicolas
Subject Re: Clients disconnect but query still runs
Date
Msg-id 081e9502-aca4-4747-b588-a0cfeb4f6ae3@26g2000yqk.googlegroups.com
Whole thread Raw
In response to Clients disconnect but query still runs  (Robert James <srobertjames@gmail.com>)
Responses Re: Clients disconnect but query still runs  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
On 27 juil, 21:49, t...@sss.pgh.pa.us (Tom Lane) wrote:
> Robert James <srobertja...@gmail.com> writes:
> > Hi.  I noticed that when clients (both psql and pgAdmin) disconnect or
> > cancel, queries are often still running on the server.  A few questions:
> > 1) Is there a way to reconnect and get the results?
>
> No.
>
> > 2) Is there a way to tell postgres to automatically stop all queries when
> > the client who queried them disconnects?
>
> No.
>
> > 3) Is there a way to see all queries whose clients have disconnected?
>
> No.

Ok then. Disconnection detection is hard.

Now, I'm in a situation where I have many "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.

Thanks for any pointers,

Nicolas


pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Postgresql Backups
Next
From: decibel
Date:
Subject: What happens when syslog gets blocked?