Probably you could get away with

import psycopg2.extensions

psycopg2.extensions.register_type(psycopg2._psycopg.MXDATETIME)
psycopg2.extensions.register_type(psycopg2._psycopg.MXINTERVAL)
psycopg2.extensions.register_type(psycopg2._psycopg.MXDATE)
psycopg2.extensions.register_type(psycopg2._psycopg.MXTIME)

assuming that you have psycopg2 compiled with the appropriate mx headers.

Hope it helps.

Michael Bayer wrote:
> my understanding is that mx is no longer supported with psycopg2.  You  
> might want to ask on their list; SA just passes through objects for  
> PG's date/time types.
>
> On May 29, 2008, at 2:27 PM, Eoghan Murray wrote:
>
>   
>> Hi,
>>
>> I'm trying to use mx.TimeDelta instead of datetime.timedelta on an
>> Interval column (with Postgres).
>> It seems to work fine until I get to intervals > a day, at which point
>> it fails with:
>>
>> ProgrammingError: (ProgrammingError) invalid input syntax for type
>> interval: "1:00:00:00.00"
>> 'INSERT INTO mytable (id, mytime) VALUES (%(id)s, %
>> (mytime)s)' {'mytime': <mx.DateTime.DateTimeDelta object for
>> '1:00:00:00.00' at 9a5bdb8>, 'id': 105461L}
>>
>> Any idea where I could hook in to give the desired "24:00:00.00"?
>>
>> Thanks!
>>
>> Eoghan
>>
>>
>>     
>
>
> >
>
> ____________________________________________________________________________________
> Internet Security Software - Click here.
> http://ads.lavabit.com/fc/Ioyw6kdbg20SYEDQ5FhJFllX2acTjh0tOS1KgVe74mslLV2hYt6kMo/
> ____________________________________________________________________________________
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to