Michael Bayer wrote:
I would love to upgrade to 0.4, 0.5, 0.6, but I can't.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. I was using heavily the column_prefix and my code is full of it, as in: mapper(Anagrafica, tbl['anagrafica'], column_prefix = 'anagrafica_', extension=History(), properties = { 'comune' : relation( Comune, primaryjoin = tbl['anagrafica'].c.id_comune == tbl['comune'].c.id ), 'nazione' : relation( Nazione, primaryjoin = tbl['anagrafica'].c.cod_cittadinanza == tbl['nazione'].c.codic... 'comune_nascita' : relation( Comune, primaryjoin = tbl['anagrafica'].c.id_comune_nascita == tbl['comune'].c.id), 'nazione_nascita': relation( Nazione, primaryjoin = tbl['anagrafica'].c.cod_nazione_nascita == tbl['nazione'].c.co... 'professione' : relation( Professione ), 'titolo_studio' : relation( TitoloStudio ), } ) and again I was using from sqlalchemy.ext.selectresults import SelectResults and I see these things are incompatible with new releases. I tried more than once, migrating to 0.4 but at end I had to give up because new releases are to different. j 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 sqlalchemy@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. -- Jose Soares Sferacarta Net Via Bazzanese 69 40033 Casalecchio di Reno Bologna - Italy Ph +39051591054 fax +390516131537 web:www.sferacarta.com Le informazioni contenute nella presente mail ed in ogni eventuale file allegato sono riservate e, comunque, destinate esclusivamente alla persona o ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza, l’integrità e la sicurezza della presente mail non possono essere garantite. Se avete ricevuto questa mail per errore, Vi preghiamo di contattarci immediatamente e di eliminarla. Grazie. This communication is intended only for use by the addressee, pursuant to legislative decree 30 June 2003, n. 196. It may contain confidential or privileged information. You should not copy or use it to disclose its contents to any other person. Transmission cannot be guaranteed to be error-free, complete and secure. If you are not the intended recipient and receive this communication unintentionally, please inform us immediately and then delete this message from your system. Thank you.-- 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. |
- [sqlalchemy] SQLAlchemy.func.max() jo
- Re: [sqlalchemy] SQLAlchemy.func.max() Michael Bayer
- Re: [sqlalchemy] SQLAlchemy.func.max() jo
- Re: [sqlalchemy] SQLAlchemy.func.max() Michael Bayer
- Re: [sqlalchemy] SQLAlchemy.func.max() jose soares