This patch does not work. The problem is in line 255:
    if isinstance(x, DateTime.DateTimeType):
I replaced it with:
    if isinstance(x, datetime.datetime):
I don't know if this is the way it should be! Any ideas?

You're right, this was missing in the patch.

Instead of patching the code, I think we should simply supplement the import of mx.DateTime with something like the following:

try:
    from mx.DateTime import DateTime, TimeDelta, DateTimeType
except ImportError:
    from datetime import datetime as DateTime, timedelta as TimeDelta, \
        datetime as DateTimeType

If we do so, the rest of the code does not need to be patched, except stripping the "DateTime."
pgdb would use mx.DateTime if available, and datetime otherwise.

> when querying a timestamp, i always get a string object (rather than
> datetime.datetime | mx.DateTime.DateTime). Is this intended?

I think this is by intent.

-- Christoph


_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to