On Dec 2, 2009, at 8:48 AM, drakkan wrote:

> Hi all,
> 
> I have a sa model working with postgres, here is a code fragment:
> 
> class Test(Base):
>       __tablename__ = 'test'
> 
>       fileld1= Column(Unicode(40), nullable=False, primary_key=True)
>       date = Column(DateTime, nullable=False)
> 
> 
> in postgres the sqltypes.DateTime is converted in:
> 
> date timestamp without time zone NOT NULL
> 
> I tryed to port my model to oracle and I found the same column has
> been translated in:
> 
> "DATE" DATE NOT NULL
> 
> I think it should be:
> 
> "DATE" TIMESTAMP NOT NULL
> 
> to have the same type between oracle and postgres,

Oracle's DATE type stores time information as well:

http://it.toolbox.com/blogs/database-solutions/a-comparison-of-oracles-date-and-timestamp-datatypes-6681

DateTime is a generic type that indicates a date that could be historic or in 
the future, so uses DATE on oracle (PG only has TIMESTAMP available).   
TIMESTAMP is more like a "system time" value.   

To force TIMESTAMP on both platforms, use the non-generic sqlalchemy.TIMESTAMP 
type.


--

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.


Reply via email to