jo wrote: > Here another difference between Oracle and PostgreSQL > The SQLAlchemy.func.max() on a column date, returns a datetime.date in > pg but a datetime.datetime in oracle... > Why this difference?
Oracle doesn't have a "date" type. this is another thing the types system smoothes out (can't speak for 0.3 though). If you're using Oracle, I can't recommend upgrading to 0.6 more strongly - Oracle was an almost completely untested alpha dialect in 0.3 and has continued to have major issues throughout 0.5, until we finally had the resources to get 100% test coverage in 0.6. > > > take a look: > > Bolletta = Table('bolletta', database.metadata, > Column('id', Integer, nullable=False, primary_key=True), > Column('data', Date) > ) > > > postgres session | oracle > session > ---------------------------------------------------------------|--------------------------------------------------------------- > In [1]: from sqlalchemy import select, func | In [1]: > from sqlalchemy import select, func > | > In [2]: select([Bolletta.c.data]).execute().scalar() | In [2]: > select([Bolletta.c.data]).execute().scalar() > SELECT bolletta.data FROM bolletta | SELECT > bolletta.data FROM bolletta > | > Out[2]: datetime.date(2007, 12, 31) | Out[2]: > datetime.date(2010, 4, 7) > | > In [3]: select([func.max(Bolletta.c.data)]).execute().scalar() | In [3]: > select([func.max(Bolletta.c.data)]).execute().scalar() > SELECT max(bolletta.data) FROM bolletta | SELECT > max(bolletta.data) FROM bolletta > | > Out[3]: datetime.date(2010, 4, 7) | Out[3]: > *datetime.datetime(*2010, 4, 7, 0, 0),) > ---------------------------------------------------------------|--------------------------------------------------------------- > > > j > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.