summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2015-11-24 13:41:07 -0500
committerDiana Clarke <diana.joan.clarke@gmail.com>2015-11-24 13:58:50 -0500
commitfd47fea6fbb11ee84b7eea5772f40855703ebe47 (patch)
treed523e7d9e25bb7a0feeb5393cf65d00b88b1efe4 /lib/sqlalchemy/sql/compiler.py
parentf7943db2f32e3cace9cadc5cf05402d425b76d33 (diff)
downloadsqlalchemy-pr/216.tar.gz
- Postgres: Do not prefix table with schema in: "FOR UPDATE of <table>"pr/216
For example, this query: SELECT s1.users.name FROM s1.users FOR UPDATE OF s1.users should actually be: SELECT s1.users.name FROM s1.users FOR UPDATE OF users fixes #3573
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index f1220ce31..d28ac313b 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1799,9 +1799,9 @@ class SQLCompiler(Compiled):
return text
def visit_table(self, table, asfrom=False, iscrud=False, ashint=False,
- fromhints=None, **kwargs):
+ fromhints=None, use_schema=True, **kwargs):
if asfrom or ashint:
- if getattr(table, "schema", None):
+ if use_schema and getattr(table, "schema", None):
ret = self.preparer.quote_schema(table.schema) + \
"." + self.preparer.quote(table.name)
else: