Commits

Mike Bayer committed e1aec1c

- 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.

  • Participants
  • Parent commits ca771ef
  • Branches rel_0_3

Comments (0)

Files changed (2)

 - 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

File lib/sqlalchemy/databases/postgres.py

                         # 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))