Hi,
I've been using pygresql-4.1.1 with python-2.7.11 and make a lot of
use of SQL arrays. I just installed pygresql-5.0.1 and my tests failed
because an SQL array value that would be returned from pygresql-4.x as
the python string:
'[2:2]={2008-07-01}'
now appears as the incorrect python list:
[datetime.date(2008, 7, 1)]
It should have been:
[None, datetime.date(2008, 7, 1)]
I'd love to not have to parse these postgresql array strings myself in
python anymore but the pygresql implementation of the array notation
parser needs to be correct.
And it doesn't seem as though I can turn off the automatic array parsing.
According to http://www.pygresql.org/contents/changelog.html it seems that
set_array(False) is only for the pg module, not the pgdb module. Calling it
from pgdb causes no error but also has no effect.
So, have I done something wrong or is the bug real and will it be fixed?
Here's a little program to demonstrate:
#!/usr/bin/env python
import pgdb
connection = pgdb.connect(host='XXX', database='XXX', user='XXX',
password='XXX')
cursor = connection.cursor()
cursor.execute("select cast('[2:2]={1}' as integer[])")
rows = cursor.fetchall()
print('%r' % rows[0][0])
# pygresql-4.2.2 outputs '[2:2]={1}' (which then needs to be parsed)
# pygresql-5.0.1 outputs [1] (which should be [None, 1])
cheers,
raf
P.S. Thanks for all the great work!
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql