From 7512b5e5482ea8a01095f98f82f1380f19a07110 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 30 Mar 2008 21:48:19 +0000 Subject: - 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 --- lib/sqlalchemy/sql/expression.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/expression.py') 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 -- cgit v1.2.1