This is postgresql.DOUBLE_PRECISION in 0.6.
[ticket:1085]
+ - Added support for reflecting the INTERVAL YEAR TO MONTH
+ and INTERVAL DAY TO SECOND syntaxes of the INTERVAL
+ type. [ticket:460]
+
- Corrected the "has_sequence" query to take current schema,
or explicit sequence-stated schema, into account.
[ticket:1576]
'bytea' : PGBinary,
'boolean' : PGBoolean,
'interval':PGInterval,
+ 'interval year to month':PGInterval,
+ 'interval day to second':PGInterval,
}
# TODO: filter out 'FOR UPDATE' statements
else:
numericprec, numericscale = charlen.split(',')
charlen = False
- if attype == 'double precision':
+ elif attype == 'double precision':
numericprec, numericscale = (True, False)
charlen = False
- if attype == 'integer':
+ elif attype == 'integer':
numericprec, numericscale = (32, 0)
charlen = False
eq_(c.primary_key, reflected_c.primary_key)
eq_(c.nullable, reflected_c.nullable)
if strict_types:
- assert type(reflected_c.type) is type(c.type), "Type '%s' doesn't correspond to type '%s'" % (reflected_c.type, c.type)
+ assert type(reflected_c.type) is type(c.type), \
+ "Type '%s' doesn't correspond to type '%s'" % (reflected_c.type, c.type)
else:
assert len(
set(type(reflected_c.type).__mro__).difference(base_mro).intersection(
def setup_class(cls):
global metadata, table
metadata = MetaData(testing.db)
+
+ # create these types so that we can issue
+ # special SQL92 INTERVAL syntax
+ class y2m(postgres.PGInterval):
+ def get_col_spec(self):
+ return "INTERVAL YEAR TO MONTH"
+
+ class d2s(postgres.PGInterval):
+ def get_col_spec(self):
+ return "INTERVAL DAY TO SECOND"
table = Table('sometable', metadata,
Column('id', postgres.PGUuid, primary_key=True),
Column('addr', postgres.PGInet),
Column('addr2', postgres.PGMacAddr),
Column('addr3', postgres.PGCidr),
- Column('doubleprec', postgres.PGDoublePrecision)
+ Column('doubleprec', postgres.PGDoublePrecision),
+ Column('plain_interval', postgres.PGInterval),
+ Column('year_interval', y2m()),
+ Column('month_interval', d2s()),
)
metadata.create_all()
+
+ # cheat so that the "strict type check"
+ # works
+ table.c.year_interval.type = postgres.PGInterval()
+ table.c.month_interval.type = postgres.PGInterval()
@classmethod
def teardown_class(cls):
t = Table('sometable', m, autoload=True)
self.assert_tables_equal(table, t, strict_types=True)
-
class MatchTest(TestBase, AssertsCompiledSQL):
__only_on__ = 'postgres'