Description of problem: the set_decimal function is not honored by the pg libs Consider the following: >>> pgdb.decimal_type() <type 'float'> >>> c.execute('select 1.1') >>> c.fetchall() [[Decimal('1.1')]] >>> pgdb.decimal_type() <type 'float'> >>> pgdb.Decimal <type 'float'> Version-Release number of selected component (if applicable): PyGreSQL-4.0-2.fc15.x86_64 Actual results: numeric values are returned as Decimal() values rather than floats, despite explicitly setting the "decimal type" Expected results: pgdb should honor the set_decimal setting (also, using Decimal by default is kind of crazy and is going to break tons of code, but it would be nice if at least the lib would honor this setting so that the workaround is less painful.) Additional info: note that a Decimal is hardly a drop-in replacement for a float. >>> Decimal(1.1)/1.0 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for /: 'Decimal' and 'float'
Reported upstream at http://mailman.vex.net/pipermail/pygresql/2011-July/002410.html
Fixed in the PyGreSQL trunk now, see http://trac.vex.net:8000/pgtracker/ticket/38
PyGreSQL-4.0-3.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/PyGreSQL-4.0-3.fc15
I'm not enough of a Python user to verify whether this patch does what you want, so please check it.
Package PyGreSQL-4.0-3.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing PyGreSQL-4.0-3.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/PyGreSQL-4.0-3.fc15 then log in and leave karma (feedback).
PyGreSQL-4.0-3.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.