Re: error in libpq reading large fields - Mailing list pgsql-bugs

From Tom Lane
Subject Re: error in libpq reading large fields
Date
Msg-id 15162.996801727@sss.pgh.pa.us
Whole thread Raw
In response to error in libpq reading large fields  (pgsql-bugs@postgresql.org)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Posgresql JDBC drivers don't compile with Jdk 1.4
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Are temp table really invisible for existing table