From 1316909da1d10b9b99fc60874c82be0371daf15e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 14 Feb 2006 00:28:52 +0000 Subject: [PATCH] fix to string concatenation operator courtesy Marko Mikulicic --- lib/sqlalchemy/databases/postgres.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 9a63748429..dab14b460d 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -277,6 +277,12 @@ class PGCompiler(ansisql.ANSICompiler): text += " \n LIMIT ALL" text += " OFFSET " + str(select.offset) return text + + def binary_operator_string(self, binary): + if isinstance(binary.type, sqltypes.String) and binary.operator == '+': + return '||' + else: + return ansisql.ANSICompiler.binary_operator_string(self, binary) class PGSchemaGenerator(ansisql.ANSISchemaGenerator): -- 2.47.2