Decode the SQL query logged by the Postgresql backend

This makes it easier to copy and paste the query when debugging.
This commit is contained in:
Cédric Krier
2025-08-27 10:00:14 +02:00
parent 771e76f0cc
commit da6b14a99b
@@ -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)