diff --git a/trytond/trytond/backend/postgresql/table.py b/trytond/trytond/backend/postgresql/table.py index 2a677f606c..1f68327e22 100644 --- a/trytond/trytond/backend/postgresql/table.py +++ b/trytond/trytond/backend/postgresql/table.py @@ -440,7 +440,7 @@ class TableHandler(TableHandlerInterface): if self._columns[column_name]['notnull']: return cursor.execute(SQL( - 'SELECT id FROM {} WHERE {} IS NULL').format( + 'SELECT id FROM {} WHERE {} IS NULL LIMIT 1').format( Identifier(self.table_name), Identifier(column_name))) if not cursor.rowcount: