Re: error in libpq reading large fields

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: sfo(at)deterministic(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: error in libpq reading large fields
Date: 2001-08-03 01:22:07
Message-ID: 15162.996801727@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-08-03 10:15:54 Are temp table really invisible for existing table
Previous Message pgsql-bugs 2001-08-02 20:04:47 Posgresql JDBC drivers don't compile with Jdk 1.4