X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 55B6232A18D for ; Sun, 17 Oct 2004 22:27:19 +0100 (BST) 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 36171-10 for ; Sun, 17 Oct 2004 21:27:16 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id DCD1232A157 for ; Sun, 17 Oct 2004 22:27:15 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CJIYY-0003F8-00; Mon, 18 Oct 2004 10:27:10 +1300 Message-ID: <4172E3AC.1040102@opencloud.com> Date: Mon, 18 Oct 2004 10:27:08 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: setBinaryStream can abandon connection References: <4172CCFC.3030503@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: 200410/183 X-Sequence-Number: 11288 Kris Jurka wrote: > The message length will not cause the backend to allocate large amounts of > memory, the individual parameter lengths are what actually allocates > memory. Are you sure about this? I see in pq_getmessage (called from the main backend loop via SocketBackend): if (len > 0) { /* Allocate space for message */ enlargeStringInfo(s, len); /* And grab the message */ if (pq_getbytes(s->data, len) == EOF) // ... } 'len' is the total packet length, not a per-parameter length. > So if we don't have a problem with a broken connection we don't actually > need to check for these errors because they don't do anything terrible, > but obviously I believe a broken connection is bad. I'd still like to see a more useful error message in the overflow case. We really shouldn't be generating a negative message length in the first place. -O