A subquery specification in a constraint definition is not allowed.
Try to formulate the search condition in such a way that the subquery is not necessary.
The attempt can be made to achieve the desired effect by defining a trigger that checks the condition.