Disconnected but query still running - Mailing list pgsql-general

From Eduardo Piombino
Subject Disconnected but query still running
Date
Msg-id CAGHqW79FaxSNOrHcZicEv+eDSA+rDTYo=Z_LDUAJ2tx4YLu1=w@mail.gmail.com
Whole thread Raw
Responses Re: Disconnected but query still running  (Venkata Balaji N <nag1010@gmail.com>)
Re: Disconnected but query still running  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-general
Hi, list.
I've been running a query from pgAdmin for a couple of hours, just to
realize that the pgAdmin timer that counts ellapsed time had stopped,
but the status bar still said "executing". So I first thought it
could've been some kind of bug with the counter. However, after some
more time, I found that a popup telling me that the connection had
been reset (the timer had stopped almost exactly at 2 hours, 7.210.123
ms to be exact, which makes me think of a 2 hours timeout somewhere).
So I closed the dialog, and then it told me that the connection had
been reset. Ok, status was updated to connection reset, but the query
was (actually is) still running, despite the disconnection (it's still
hammering the disk, and it shows up in one of the pg_views showing
running quesries).

I've read that that a query still running after a disconnection is
normal, since the server won't realize about this disconnection until
it needs to send some data back to the client, which is ok and
understandable. But my question is, what happens when the query
finishes? FYI, the query was an update, in what would be autocommit
mode (no explicit transaction was open). Will the changes be commited?
or rollbacked because it will detect the disconnection later on? In
other words, is it worth waiting for this query to finish (it has been
running for almost 7 hours now), or should I cancel it because it will
irremediably be rolled back when the server finds theres no one on the
other end of the tcp connection?

Thanks.
Eduardo


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: How to test SSL cert from CA?
Next
From: "Charles Clavadetscher"
Date:
Subject: Row level security - notes and questions