Am 21.12.2013 16:27, schrieb Michael Bayer:
In the case of using Postgresql, the type
sqlalchemy.dialects.postgresql.INTERVAL takes over wherever you might
have used a sqlalchemy.Interval type.    In this case, psycopg2 is
what’s doing whatever conversions are occurring here - if a result
row type has the Postgres OID for an “INTERVAL”, psycopg2 jumps in
and does the conversion to timedelta.  This isn’t on the SQLAlchemy
side.   If psycopg2 is doing the wrong thing you might want to look
over on their side for updates or bug reports.

I don't really know if psycopg2 is doing the wrong thing. Py-postgresql does the same conversion. This might be viewed as a problem with datetime.timedelta which isn't suitable for intervals of several months.

So if what you’re getting at is using CAST, so that by the time the
result value hits psycopg2 it’s a plain character, SQLAlchemy uses
the cast() function to achieve that result.

Looks good, I'll try it. I think my problem is too little knowledge of the SQL expression language, I've used only the ORM with the declarative extension. So this may take a while.

Thank you for steering me into the right direction,
Sibylle

--
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+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to