From 892a1ebcb8f9fdecaf38b1725175d52c7b245a16 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 20 Oct 2006 20:49:16 +0000 Subject: fixed pg reflection of timezones --- lib/sqlalchemy/databases/postgres.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/databases/postgres.py') diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index dad2d3bff..93a2cf864 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -359,14 +359,20 @@ class PGDialect(ansisql.ANSIDialect): if attype == 'integer': numericprec, numericscale = (32, 0) charlen = None - + args = [] for a in (charlen, numericprec, numericscale): if a is not None: args.append(int(a)) + + kwargs = {} + if attype == 'timestamp with time zone': + kwargs['timezone'] = True + elif attype == 'timestamp without time zone': + kwargs['timezone'] = False coltype = ischema_names[attype] - coltype = coltype(*args) + coltype = coltype(*args, **kwargs) colargs= [] if default is not None: colargs.append(PassiveDefault(sql.text(default))) -- cgit v1.2.1