Skip site navigation (1) Skip section navigation (2)

Re: setBinaryStream can abandon connection

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: setBinaryStream can abandon connection
Date: 2004-10-17 21:27:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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 


In response to


pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-10-17 21:50:22
Subject: Re: setBinaryStream can abandon connection
Previous:From: Kris JurkaDate: 2004-10-17 21:15:49
Subject: Re: setBinaryStream can abandon connection

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group