Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de> writes:
> I'm having trouble with PQsendQuery if sending medium sized
> queries. Everything's fine with queries up to 8190 bytes (0x1fffe), but one
> byte more will not work.
libpq's nonblock mode is incredibly fragile, not to say completely
broken. See discussion from, eg, Jan 2000:
and nearby comments.
AFAIK most of those complaints never did get addressed; so the nonblock
mode works under light load but falls over as soon as it's stressed at
all. I'd like to see it rewritten properly, but have not had time
Making pqPutBytes willing to realloc the output buffer bigger would
definitely help, but it's not the only thing needed to make nonblock
mode robust, per comments in above messages.
BTW, reallocing just big enough to handle the current input is not the
way to go; that will result in lots of malloc traffic if the caller adds
a few bytes at a time. I'd think about doubling the buffer size until
it's big enough. Your proposed code is also nonrobust about running out
regards, tom lane
In response to
pgsql-interfaces by date
|Next:||From: Bruce Badger||Date: 2003-04-01 23:04:21|
|Subject: The new FE/BE protocol|
|Previous:||From: Alvaro Herrera||Date: 2003-04-01 19:25:52|
|Subject: Re: Oracle Porting, Compiere|