From da6b14a99bd8253fff0d635dcb7e335b19797e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 27 Aug 2025 10:00:14 +0200 Subject: [PATCH] Decode the SQL query logged by the Postgresql backend This makes it easier to copy and paste the query when debugging. --- trytond/trytond/backend/postgresql/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/backend/postgresql/database.py b/trytond/trytond/backend/postgresql/database.py index cd8590d66b..28aef43fa3 100644 --- a/trytond/trytond/backend/postgresql/database.py +++ b/trytond/trytond/backend/postgresql/database.py @@ -70,7 +70,7 @@ def replace_special_values(s, **mapping): class LoggingCursor(cursor): def execute(self, sql, args=None): if logger.isEnabledFor(logging.DEBUG): - logger.debug(self.mogrify(sql, args)) + logger.debug('query: %s', self.mogrify(sql, args).decode()) cursor.execute(self, sql, args)