From: Mike Bayer Date: Thu, 9 Aug 2007 19:44:42 +0000 (+0000) Subject: - when reflecting tables from alternate schemas, the "default" placed upon X-Git-Tag: rel_0_3_11~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff298585a056bbcf2116523eb58f39e3de8a1c8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - when reflecting tables from alternate schemas, the "default" placed upon the primary key, i.e. usually a sequence name, has the "schema" name unconditionally quoted, so that schema names which need quoting are fine. its slightly unnecessary for schema names which don't need quoting but not harmful. --- diff --git a/CHANGES b/CHANGES index e0a59eddac..621ea0db09 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,12 @@ - mssql - added support for TIME columns (simulated using DATETIME) [ticket:679] - index names are now quoted when dropping from reflected tables [ticket:684] +- postgres + - when reflecting tables from alternate schemas, the "default" placed upon + the primary key, i.e. usually a sequence name, has the "schema" name + unconditionally quoted, so that schema names which need quoting are fine. + its slightly unnecessary for schema names which don't need quoting + but not harmful. 0.3.10 - general diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index d3726fc1ff..d0b97175df 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -464,7 +464,7 @@ class PGDialect(ansisql.ANSIDialect): # the default is related to a Sequence sch = table.schema if '.' not in match.group(2) and sch is not None: - default = match.group(1) + sch + '.' + match.group(2) + match.group(3) + default = match.group(1) + ('"%s"' % sch) + '.' + match.group(2) + match.group(3) colargs.append(schema.PassiveDefault(sql.text(default))) table.append_column(schema.Column(name, coltype, nullable=nullable, *colargs))