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