summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_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 /test/dialect/postgresql/test_compiler.py
parentf7943db2f32e3cace9cadc5cf05402d425b76d33 (diff)
downloadsqlalchemy-fd47fea6fbb11ee84b7eea5772f40855703ebe47.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 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 78217bd82..0c0f9c589 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -580,6 +580,22 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"WHERE mytable_1.myid = %(myid_1)s FOR UPDATE OF mytable_1"
)
+ def test_for_update_with_schema(self):
+ m = MetaData()
+ table1 = Table(
+ 'mytable', m,
+ Column('myid'),
+ Column('name'),
+ schema='testschema'
+ )
+
+ self.assert_compile(
+ table1.select(table1.c.myid == 7).with_for_update(of=table1),
+ "SELECT testschema.mytable.myid, testschema.mytable.name "
+ "FROM testschema.mytable "
+ "WHERE testschema.mytable.myid = %(myid_1)s "
+ "FOR UPDATE OF mytable")
+
def test_reserved_words(self):
table = Table("pg_table", MetaData(),
Column("col1", Integer),