Re: Bug report: psycopg2 doesn't allow large-object write() for large strings.

Will Kraytos <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
2009/5/19 Federico Di Gregorio <fog-NGVKUo/i/[email protected]>:
> Il giorno mar, 19/05/2009 alle 14.04 -0700, Will Kraytos ha scritto:
>> >>> import psycopg2
>> >>> conn = psycopg2.connect('user=postgres')
>> >>> lobject = conn.lobject()
>> >>> lobject.write('*' * 10000)
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>> psycopg2.OperationalError
>> >>> lobject.write('*' * 1000)
>> 1000
>> As you can see, lobject.write(s) works where s is 1KB, but fails for a
>> 10KB string. This is for psycopg 2.0.10.
>
> Thanks. I'll check this one ASAP.

Thanks a lot.

BTW, if that helps at all, I've verified the lobject.py example that
comes bundled with psycopg2's source fails for the exact same reason:

~/psycopg2-2.0.10/examples$ python lobject.py
Opening connection using dns: dbname=test
Encoding for this connection is UTF8
Created a new large object with oid 222231
Manually importing some binary data into the object:
Traceback (most recent call last):
  File "lobject.py", line 39, in <module>
    len = lobj.write(data)
psycopg2.OperationalError
psycopg2.OperationalError


The full psycopg2 version string is: '2.0.10 (dt dec ext pq3)'

This is running on Leopard 10.5.7, against PG 8.3.7.

Let me know if there's anything else I can check or tell you that would help.

--W.K.

> federico
>
> --
> Federico Di Gregorio                         http://people.initd.org/fog
> Debian GNU/Linux Developer                                [email protected]
> INIT.D Developer                                           fog-NGVKUo/i/[email protected]
>                      Sei una bergogna. Vergonga. Vergogna. -- Valentina
>
> _______________________________________________
> Psycopg mailing list
> Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
> http://lists.initd.org/mailman/listinfo/psycopg
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.