On Sat, Sep 18, 2004 at 02:32:32PM -0400, Tom Lane wrote:
> No, because of the reporting delay. I would recommend waiting for the
> backend's row in pg_stat_activity to disappear entirely. Under normal
> circumstances that should occur quickly. If there's a communications
> problem, it might take awhile to detect connection loss ... but if
> there's a communications problem, you probably aren't going to be able
> to open a new connection, either.
Unfortunately, a communications problem is exactly the kind of scenario
we were talking about in the first place! Might be a misguided firewall,
for instance. (In which case we'd want the TCP connection to time out
quickly on the server as well to avoid piling up dead backends, but that's
another matter).
BTW is there really no other way to see if a query (for the same user who's
looking) is still executing? It'd be really helpful if the check could be
done from the same client process that lost the connection in the first
place.
Jeroen