Oracle should use the native interval type for the sqlalchemy interval type in the same way postgresql does

Issue #1467 resolved
Former user created an issue

As of cx_Oracle 5.0, the Oracle engine supports a native interval type and it should be used instead of a timestamp. Postgresql has support for this in sqlalchemy and it should be extended to Oracle. This will also help reflection as oracle interval types do not like being bound to timestamp types.

Comments (5)

  1. Former user Account Deleted

    a couple of quick and dirty patches to get things going

    sqlalchemy-0.5.4p2/lib/sqlalchemy/databases/oracle.py 146,149d145 < class OracleInterval(sqltypes.Interval): < def get_col_spec(self): < return "INTERVAL" < 294d289 < sqltypes.Interval : OracleInterval,

    sqlalchemy-0.5.4p2/lib/sqlalchemy/types.py 823,825c823 < import sqlalchemy.databases.oracle as oracle < self.__supported = {pg.PGDialect:pg.PGInterval, oracle.OracleDialect:oracle.OracleInterval} < del oracle


        self.__supported = {pg.PGDialect:pg.PGInterval}
    
  2. Mike Bayer repo owner
    • changed milestone to 0.6.0

    this is targeted towards 0.6 and should probably be dynamically modified based on the detected version of cx_oracle, as well as the version of Oracle actually present (unless Oracle has it going back to 8)

  3. Former user Account Deleted

    If cx_Oracle version is >= 5.0 released 12/13/2008 then all supported versions of Oracle have a native interval type. Oracle versions < 9i circa 2001 do not have a native interval type.

    Replying to zzzeek:

    this is targeted towards 0.6 and should probably be dynamically modified based on the detected version of cx_oracle, as well as the version of Oracle actually present (unless Oracle has it going back to 8)

  4. Log in to comment