The Oracle database only has one date type, and it includes time. If you
require date only it is up to you to extract the date. Alternatively, if
you really care about date only for all usage of that column, store it with
a time of 00:00:00.
 On Mar 30, 2012 8:08 AM, "jo" <jose.soa...@sferacarta.com> wrote:

> shinriyo wrote:
>
>> hi jo
>>
>> Oracle and PostgreSQL are different.
>> Oracle also have hour and minutes and second.
>>
>> If you want minutes and second on PostgresQL, you should use datetime.
>>
>>
>>
>
> Hi shinryo,
>
> I don't want hours and minutes.
> My problem is that I have a comparison in my code like this:
>
> if   data_inizio > data_fine:
>    ...
>
> TypeError: can't compare datetime.datetime to datetime.date
>
> --------------
>
> data_inizio  is a value returned by:
>     Frazione.get(31).tariffa_data_**inizio   # returns an object
> datetime.date (both oracle and pg)
>
> data_fine is a value returned by engine: #oracle returns a datetime while
> pg returns a date
>   engine.connect().execute('**select data_fine from tariffa where
> id_frazione=31').fetchone()
>
>
> I would like to know why Oracle engine returns dates as datetime.datetime
> instead of datetime.date
> and if there is a way to have the same behavior between oracle and pg in
> such case.
>
> 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+unsubscribe@**
> googlegroups.com <sqlalchemy%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/sqlalchemy?hl=en <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 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