[sqlalchemy] why func.sum(some_table.c.bigintfield) returns Decimal ?

2011-09-26 Thread sector119
Hello. Why func.sum(some_table.c.bigintfield) returns Decimal ? documents_table.c.sum has BigInteger type (postgresql table field has bigint type) the same issue I got with postgresql date_part func, when I extract year or month I got Decimal result, not int s =

Re: [sqlalchemy] why func.sum(some_table.c.bigintfield) returns Decimal ?

2011-09-26 Thread Michael Bayer
func.sum(), being a known generic function in sql/functions.py, by default will denote the return value as having the same SQL type as the value that was passed in. The BigInteger type object though doesn't do any python-side processing right now, its assumed DBAPIs can handle sending an