diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/sqlalchemy/databases/postgres.py | 6 |
2 files changed, 6 insertions, 1 deletions
@@ -40,6 +40,7 @@ - postgres: - better reflection of sequences for alternate-schema Tables [ticket:442] - sequences on a non-pk column will properly fire off on INSERT + - added PGInterval type [ticket:460] - ext: - added distinct() method to SelectResults. generally should only make a difference when using count(). diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 74b23d8f9..24c250f7a 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -112,7 +112,10 @@ class PG1Time(sqltypes.Time): return value def get_col_spec(self): return "TIME " + (self.timezone and "WITH" or "WITHOUT") + " TIME ZONE" - +class PGInterval(sqltypes.TypeEngine): + def get_col_spec(self): + return "INTERVAL" + class PGText(sqltypes.TEXT): def get_col_spec(self): return "TEXT" @@ -171,6 +174,7 @@ pg2_ischema_names = { 'time': PG2Time, 'bytea' : PGBinary, 'boolean' : PGBoolean, + 'interval':PGInterval, } pg1_ischema_names = pg2_ischema_names.copy() pg1_ischema_names.update({ |