X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4B122D1B1B4 for ; Mon, 26 Jul 2004 02:45:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80109-01 for ; Mon, 26 Jul 2004 05:45:20 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0573ED1B170 for ; Mon, 26 Jul 2004 02:45:13 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6Q5jINB019313; Mon, 26 Jul 2004 01:45:18 -0400 (EDT) To: John Rogers Cc: pgsql-odbc@postgresql.org Subject: Re: hanging select processes In-reply-to: <40FBA013.3090905@delosis.com> References: <40FBA013.3090905@delosis.com> Comments: In-reply-to John Rogers message dated "Mon, 19 Jul 2004 11:18:59 +0100" Date: Mon, 26 Jul 2004 01:45:18 -0400 Message-ID: <19312.1090820718@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/141 X-Sequence-Number: 4274 John Rogers writes: > surely postgres should stop the select if the client > dissapears in a puff of smoke? The current design intention is that the backend will notice loss of connection when it next tries to receive a command from the client --- and not before. You could argue that a SELECT is side-effect free and can be aborted arbitrarily, but I wouldn't agree, because the SELECT could be invoking a user-defined function that does have side effects. If we were to abort upon noticing that the output data didn't seem to be going anywhere, then the behavior would be both timing-dependent and platform-dependent. > ... we end up with a postgres SELECT thread running at 99% cpu > time on our backend. If the SELECT is taking more CPU than it otherwise would, then that might represent a bug we oughta fix. But I don't think that finishing out a requested SELECT is in and of itself a bug. regards, tom lane