oh, now i just understood your email.

I would say this should be added to the wiki:

http://www.sqlalchemy.org/trac/wiki/DatabaseNotes

which i have just done!

psycopg1 is no longer supported...this float issue is just one of many.

On Jun 3, 2006, at 3:42 AM, Yuan HOng wrote:

> Thanks for pointing this out. I found out that psycopg 1.1.21 gives
> back a Numeric as float. When I switched to psycopg2, a Decimal object
> is automatically returned.
>
> I was switching from SQLObjects, and there the Numeric is
> automatically converted to Decimal seemingly by SQLObjects, so I took
> that for granted. Maybe this should also be added to SA, since then
> the application won't be dependant on the return type of the DBAPI
> layer?
>
> On 6/3/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
>> the float type coming from Numeric etc. is straight from the DBAPI,
>> in this case psycopg2.  If youd like to make your own Decimal type
>> which translates this value back and forth from whatever float value
>> psycopg2 is giving you, simply subclass TypeDecorator, specify
>> Numeric as the 'impl',  and implement the appropriate
>> convert_bind_param(), convert_result_value() methods.
>>
>> instructions are here:
>>
>>         http://www.sqlalchemy.org/docs/types.myt#types_custom
>>
>> if you get that done, theres no reason it cant be stuck into the
>> types module, just wouldnt be available if youre on 2.3.
>>
> -- 
> Hong Yuan
>
> 大管家网上建材超市
> 装修装潢建材一站式购物
> http://www.homemaster.cn
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to