Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJkM6-0002gG-Sm for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2016 17:07:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cJkM6-00085v-9W for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2016 17:07:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cJkKh-0006VM-LL for pgsql-hackers@postgresql.org; Wed, 21 Dec 2016 17:05:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cJkKe-00033V-Bu for pgsql-hackers@postgresql.org; Wed, 21 Dec 2016 17:05:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uBLH5YqL020649; Wed, 21 Dec 2016 12:05:34 -0500 From: Tom Lane To: "David G. Johnston" cc: "pgsql-hackers@postgresql.org" Subject: Re: Getting rid of "unknown error" in dblink and postgres_fdw In-reply-to: References: <19872.1482338965@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Wed, 21 Dec 2016 09:55:23 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20647.1482339934.1@sss.pgh.pa.us> Date: Wed, 21 Dec 2016 12:05:34 -0500 Message-ID: <20648.1482339934@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org "David G. Johnston" writes: > On Wed, Dec 21, 2016 at 9:49 AM, Tom Lane wrote: >> A possible objection is that if we really are on the hairy edge of OOM, >> trying to construct such error strings might push us over the edge > What am I missing here? Constructing said string occurs on the local end > of the connection but the memory problem exists on the remote end. Um, that's not clear, in fact it's not likely. The backend usually manages to tell you so if it's out of memory --- or, worst case, it crashes trying, in which case the local libpq ought to gin up a report about loss of connection. So the root cause I'm suspecting is that the local libpq was unable to obtain memory for a PGresult or something like that. That theory has some holes of its own, because libpq also keeps some cards up its sleeve that usually let it report out-of-memory successfully, but it's the best I can do with the info at hand. In any case, the point of the error style guidelines is that it's *always* possible to do better than "unknown error"; now that it's been proven that this case is reachable in the field, we should try harder. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers