From 71c45937f9adbb64482fffcda75f8fe4d063e027 Mon Sep 17 00:00:00 2001 From: Mario Lassnig Date: Tue, 12 Nov 2013 23:08:51 +0100 Subject: add psql FOR UPDATE OF functionality --- lib/sqlalchemy/dialects/postgresql/base.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index e1dc4af71..19d7c81fa 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1015,6 +1015,8 @@ class PGCompiler(compiler.SQLCompiler): def for_update_clause(self, select): if select.for_update == 'nowait': + if select.for_update_of is not None: + return " FOR UPDATE OF " + select.for_update_of + " NOWAIT" return " FOR UPDATE NOWAIT" elif select.for_update == 'read': return " FOR SHARE" -- cgit v1.2.1