- changed status to resolved
PostgreSQL interval type
I got an error trying to use sqlalchemy with an existing PostgreSQL 8.1 database. Postgres provides a rather unusual type: 'interval' (see http://www.postgresql.org/docs/8.2/interactive/datatype-datetime.html) which psycopg2 translates to a datetime.timedelta object.
I've looked at sqlalchemy.types and sqlalchemy.databases.postgres but it seems no code handles such a data type.
Comments (7)
-
repo owner -
Account Deleted - changed status to open
- removed status
Despite the fact PostgreSQL has only one interval data type, it supports SQL92 syntax which has two distinct interval data types.
INTERVAL YEAR [(year_precision)]((year_precision)) TO MONTH INTERVAL DAY [(day_precision)]((day_precision)) TO SECOND [(fractional_seconds_precision)]((fractional_seconds_precision))
If column was created using ISO syntax, its type stored as '
interval year to month
' or 'interval day to second
' which sqlalchemy doesn't recognize. -
repo owner -
repo owner - changed milestone to 0.6.xx
-
Account Deleted Also applies to oracle with cx_oracle >= 5.0.
-
repo owner the oracle interval type is a dupe of
#1467. PG ISO syntax support is in for 0.5 and 0.6 in 2a34d521a3d6cece1e6748e17fe8bf46c86b8f70, e8854fe945e94d0fe654e83397c47f8b0fb1f1e8. support for the "precision" argument added in 0.6. -
repo owner - removed milestone
Removing milestone: 0.5.7 (automated comment)
- Log in to comment
fixed in changeset:2305. if problem persists then re-open.