pgsql-bugs@postgresql.org writes:
> Problem observed with Postgres 7.1.12 on SunOS 5.6.
> Application using libpq running the following:
> DECLARE companies CURSOR FOR SELECT c.streamableobject FROM company c, company_ric cr WHERE c.ric = cr.ric and
cr.companyric= 'CM.TO'
> FETCH ALL IN companies
> would fail when c.streamableobject exceeded 16K bytes in size,
> c.streamableobject being a TEXT field.
Please define "fail". I don't see what the problem is here. You appear
to me to be reducing performance (by forcing an extra read call that's
likely to be wasted cycles), and I don't see why it matters. pqReadData
is not expected or required to fill the buffer to the tippy-top, only to
fetch at least one more byte if any data is available. (Perhaps you've
found a path where a caller fails to honor those semantics, but if so
the bug is in that caller not in pqReadData.)
Also, a reversed diff with no context lines is just about unreadable
:-(, so it might be just that I'm misinterpreting the proposed change.
Please show it as a forward diff -c.
regards, tom lane