I can't reproduce that. Here's a test:
from sqlalchemy import create_engine, Numeric, MetaData, Table,
Column
m = MetaData()
t = Table('x', m, Column('data', Numeric))
e = create_engine("postgresql://scott:tiger@localhost/test",
echo=True)
c = e.connect()
tr = c.begin()
m.create_all(c)
c.execute(
t.insert(),
{"data":
2468432255.0}
)
What is the actual NUMERIC type in the schema? If you make a
NUMERIC type with too low of a precision/scale, the number will be
rejected. example:
from sqlalchemy import create_engine, Numeric, MetaData, Table,
Column
m = MetaData()
t = Table('x', m, Column('data', Numeric(6, 2)))
e = create_engine("postgresql://scott:tiger@localhost/test",
echo=True)
c = e.connect()
tr = c.begin()
m.create_all(c)
c.execute(
t.insert(),
{"data":
2468432255.0}
)
output:
sqlalchemy.exc.DataError: (psycopg2.DataError) numeric field
overflow
DETAIL: A field with precision 6, scale 2 must round to an absolute
value less than 10^4.
[SQL: 'INSERT INTO x (data) VALUES (%(data)s)'] [parameters:
{'data':
2468432255.0}]
Please adapt the test above to illustrate how you're getting your
error exactly.
Any idea?
Thanks,
Chengjun
--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.