From 6a3e993490ebedce39983a90ced3a87817e6d4ef Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 16 Sep 2012 17:43:21 -0400 Subject: - genericize the test for ischema_names - some fixes to the patch to handle empty args, whitespace - changelog clarifies where this API fits at the moment --- lib/sqlalchemy/dialects/postgresql/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index f59aa50b4..4e30a76c4 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1471,7 +1471,7 @@ class PGDialect(default.DefaultDialect): """ s = sql.text(SQL_COLS, bindparams=[sql.bindparam('table_oid', type_=sqltypes.Integer)], - typemap={'attname':sqltypes.Unicode, 'default':sqltypes.Unicode} + typemap={'attname': sqltypes.Unicode, 'default': sqltypes.Unicode} ) c = connection.execute(s, table_oid=table_oid) rows = c.fetchall() @@ -1501,8 +1501,8 @@ class PGDialect(default.DefaultDialect): if charlen: charlen = charlen.group(1) args = re.search('\((.*)\)', format_type) - if args: - args = tuple(args.group(1).split(',')) + if args and args.group(1): + args = tuple(re.split('\s*,\s*', args.group(1))) else: args = () kwargs = {} @@ -1535,7 +1535,7 @@ class PGDialect(default.DefaultDialect): args = (int(charlen),) else: args = () - elif attype in ('interval','interval year to month', + elif attype in ('interval', 'interval year to month', 'interval day to second'): if charlen: kwargs['precision'] = int(charlen) -- cgit v1.2.1