]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added PGInterval type [ticket:460]
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Feb 2007 19:32:36 +0000 (19:32 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Feb 2007 19:32:36 +0000 (19:32 +0000)
CHANGES
lib/sqlalchemy/databases/postgres.py

diff --git a/CHANGES b/CHANGES
index 891b88bd380fee0130f4dfcbc604b40badf0f552..9aab59481e1a47ef4c2a44206191f53632e59ebe 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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().
index 74b23d8f9eadb998a7729065063eb3b016306762..24c250f7a1cbdca356ba12fded66ed5022380fb2 100644 (file)
@@ -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({