details:   https://code.tryton.org/tryton/commit/0c2a2477e2b2
branch:    default
user:      Cédric Krier <[email protected]>
date:      Sat Jan 24 08:51:39 2026 +0100
description:
        Convert index expression to string to instantiate psycopg2 SQL

        Closes #14487
diffstat:

 trytond/trytond/backend/postgresql/table.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r cccc07dc0544 -r 0c2a2477e2b2 trytond/trytond/backend/postgresql/table.py
--- a/trytond/trytond/backend/postgresql/table.py       Wed Jan 14 19:25:17 
2026 +0100
+++ b/trytond/trytond/backend/postgresql/table.py       Sat Jan 24 08:51:39 
2026 +0100
@@ -653,9 +653,9 @@
         else:
             expression_str = str(expression)
             if expression_str.startswith('(') and expression_str.endswith(')'):
-                variables['expression'] = SQL(expression)
+                variables['expression'] = SQL(expression_str)
             else:
-                variables['expression'] = SQL(f'({expression})')
+                variables['expression'] = SQL(f'({expression_str})')
         if usage.options.get('collation'):
             variables['collate'] = SQL('COLLATE {}').format(
                 usage.options['collation'])

Reply via email to