X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A8A9352815 for ; Tue, 9 Aug 2005 13:27:12 -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 34985-10 for ; Tue, 9 Aug 2005 16:26:54 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id A673E52A28 for ; Tue, 9 Aug 2005 13:26:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j79GQqZP016905; Tue, 9 Aug 2005 12:26:52 -0400 (EDT) To: jtv@xs4all.nl Cc: pgsql-interfaces@postgresql.org Subject: Re: Getting results after networking error In-reply-to: <4395.210.86.147.191.1123600604.squirrel@210.86.147.191> References: <4395.210.86.147.191.1123600604.squirrel@210.86.147.191> Comments: In-reply-to jtv@xs4all.nl message dated "Tue, 09 Aug 2005 17:16:44 +0200" Date: Tue, 09 Aug 2005 12:26:52 -0400 Message-ID: <16904.1123604812@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200508/6 X-Sequence-Number: 5677 jtv@xs4all.nl writes: > I sometimes issue multiple queries at once using semicolons, so one call > returns multiple results. Now let's say my network connection to the > backend breaks and not all the results can be returned--I get a result > with some error code (wish I knew which, but that's another story) > followed by a NULL result to indicate that no more results are following, > right? > Now let's say that I issue my next query and the network connection > recovers in the process. I happily start retrieving results again, but > are they only results for the new query, or do I go through the remaining > results of the last query first? I don't think there is a unique answer to that, without a whole lot of assumptions about the nature of the failure and the behavior of the network transport layer. Did the backend see any send() failures? Did the transport layer permanently lose any data already given to it, or just delay transmission? On the whole I think the odds of re-syncing successfully are pretty bad, and you'd be best off to pull the plug and start a new connection if you see any networking failure. regards, tom lane