]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- when reflecting tables from alternate schemas, the "default" placed upon
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Aug 2007 19:44:42 +0000 (19:44 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Aug 2007 19:44:42 +0000 (19:44 +0000)
      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.

CHANGES
lib/sqlalchemy/databases/postgres.py

diff --git a/CHANGES b/CHANGES
index e0a59eddacaaf8868045fede855fdf2bc9781f76..621ea0db09fed4680114e31938a7336db999b934 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 - 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
index d3726fc1ff02de58d10a20659e2384e1aa06e64c..d0b97175df40efcd91fce2e51ecf62f268035c77 100644 (file)
@@ -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))