Hi all,

I found a difference between Oracle and PostgreSQL about datetime objects.
Using the engine Oracle returns every date column as datetime.datetime
while PostgreSQL returns it as datetime.date

I have a table with a column data_inizio defined as DATE in table tariffa in my db.

take a look:


In [5]: engine.connect().execute('select data_inizio from tariffa where id=391').fetchone()
Out[5]: (datetime.datetime(2009, 1, 1, 0, 0),)

In [6]: type(Tariffa.get(391).tariffa_data_inizio)
Out[6]: <type 'datetime.date'>

----------------

In [1]: engine.connect().execute('select data_inizio from tariffa where id=391').fetchone()
Out[1]: (datetime.date(2009, 1, 1),)

In [2]: type(Tariffa.get(391).tariffa_data_inizio)
Out[2]: <type 'datetime.date'>


Why this difference? Is there a way to change Oracle behavior in engine?

thanks for any help.

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.

Reply via email to