python 3k version does not accept Decimal objects as bind parameters

Bug #411133 reported by Mike Bayer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pg8000
New
Undecided
Unassigned

Bug Description

test case passes with python 2k, fails with the latest hg tip at http://hg.pybrary.net/pg8000-py3/ :

from pg8000 import dbapi
from decimal import Decimal

connection = dbapi.connect(user='scott', host='localhost', database='test', password='tiger')
cursor = connection.cursor()

cursor.execute("""
CREATE TABLE numeric_table (
    numericcol NUMERIC(10, 2)
)
""")

# works on both Py2K/Py3K
cursor.execute("""INSERT INTO numeric_table (numericcol) VALUES (%s)""", [3.5])

# works on Py2K, fails on Py3K
cursor.execute("""INSERT INTO numeric_table (numericcol) VALUES (%s)""", [Decimal('3.5')])

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.