> I would like to make the following constraint in my db.
>
> [...]
>
> Is it possible?
> How can I do that?
>
It is possible to impose arbitrarily complex constraints
with TRIGGERs.
The idea is to raise an exception in the trigger body
when illegal values are inserted or updated.
Christoph Dalitz