select array exception

Bug #629260 reported by DDarko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pg8000
Fix Committed
Undecided
Unassigned

Bug Description

"""
Table "company"
    Column | Type | Modifiers
 phone | character varying(150)[] | not null
...
"""

from pg8000 import DBAPI
conn = DBAPI.connect(host="localhost", user="postgres", password="postgres", database="kpf")
cursor = conn.cursor()
cursor.execute("select phone from company limit 2;")
for row in cursor:
 print row

cursor.close()
conn.close()

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    cursor.execute("select phone from company limit 2;")
  File "build/bdist.linux-x86_64/egg/pg8000/dbapi.py", line 243, in _fn
  File "build/bdist.linux-x86_64/egg/pg8000/dbapi.py", line 314, in execute
  File "build/bdist.linux-x86_64/egg/pg8000/dbapi.py", line 319, in _execute
  File "build/bdist.linux-x86_64/egg/pg8000/interface.py", line 304, in execute
  File "build/bdist.linux-x86_64/egg/pg8000/interface.py", line 146, in execute
  File "build/bdist.linux-x86_64/egg/pg8000/interface.py", line 160, in _fill_cache
  File "build/bdist.linux-x86_64/egg/pg8000/protocol.py", line 913, in _fn
  File "build/bdist.linux-x86_64/egg/pg8000/protocol.py", line 1163, in fetch_rows
  File "build/bdist.linux-x86_64/egg/pg8000/protocol.py", line 881, in handle_messages
  File "build/bdist.linux-x86_64/egg/pg8000/protocol.py", line 1178, in _fetch_datarow
  File "build/bdist.linux-x86_64/egg/pg8000/types.py", line 189, in py_value

  File "build/bdist.linux-x86_64/egg/pg8000/types.py", line 441, in array_recv

struct.error: unpack requires a string argument of length 4

DDarko (ddarko)
tags: added: pg8000-1.08-py2.6.egg
Revision history for this message
Mariano Reingart (reingart) wrote :

I've made a maintenance fork:

http://code.google.com/p/pg8000/

Could you test the latest version?

Several array issues were fixed.
If the error persist, please could you report it in the googlecode project issues?
(some data to build a unittest would be great)

Changed in pg8000:
status: New → Incomplete
status: Incomplete → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.