summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 99c48fb2f..f9108094f 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -1747,14 +1747,11 @@ class PGCompiler(compiler.SQLCompiler):
return self._generate_generic_binary(
binary, " %s* " % base_op, **kw
)
- flags = self.process(flags, **kw)
- string = self.process(binary.left, **kw)
- pattern = self.process(binary.right, **kw)
return "%s %s CONCAT('(?', %s, ')', %s)" % (
- string,
+ self.process(binary.left, **kw),
base_op,
- flags,
- pattern,
+ self.process(flags, **kw),
+ self.process(binary.right, **kw),
)
def visit_regexp_match_op_binary(self, binary, operator, **kw):
@@ -1767,8 +1764,6 @@ class PGCompiler(compiler.SQLCompiler):
string = self.process(binary.left, **kw)
pattern = self.process(binary.right, **kw)
flags = binary.modifiers["flags"]
- if flags is not None:
- flags = self.process(flags, **kw)
replacement = self.process(binary.modifiers["replacement"], **kw)
if flags is None:
return "REGEXP_REPLACE(%s, %s, %s)" % (
@@ -1781,7 +1776,7 @@ class PGCompiler(compiler.SQLCompiler):
string,
pattern,
replacement,
- flags,
+ self.process(flags, **kw),
)
def visit_empty_set_expr(self, element_types):