diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-30 21:48:19 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-30 21:48:19 +0000 |
commit | 7512b5e5482ea8a01095f98f82f1380f19a07110 (patch) | |
tree | c262ad7eae3bb2331a9bdd46fff79c2f3f46b9d7 /lib/sqlalchemy/sql/expression.py | |
parent | c096aeefe04ff77dbbef084923c75bf928620a27 (diff) | |
download | sqlalchemy-7512b5e5482ea8a01095f98f82f1380f19a07110.tar.gz |
- schema-qualified tables now will place the schemaname
ahead of the tablename in all column expressions as well
as when generating column labels. This prevents cross-
schema name collisions in all cases [ticket:999]
- the "use_schema" argument to compiler.visit_column() is removed. It uses
schema in all cases now.
- added a new test to the PG dialect to test roundtrip insert/update/delete/select
statements with full schema qualification
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r-- | lib/sqlalchemy/sql/expression.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 3d95948cb..2cd10720a 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2632,7 +2632,10 @@ class _ColumnClause(ColumnElement): return None if self.__label is None: if self.table is not None and self.table.named_with_column: - self.__label = self.table.name + "_" + self.name + if getattr(self.table, 'schema', None): + self.__label = "_".join([self.table.schema, self.table.name, self.name]) + else: + self.__label = "_".join([self.table.name, self.name]) counter = 1 while self.__label in self.table.c: self.__label = self.__label + "_%d" % counter |