This a known problem which is caused by subselects in check constraints.
Current sources seem to give an error message at create time:
ERROR: Cannot use subselect in CHECK clause
In general subselects in check constraints also may constrain tables
that the subselect mentions. In your case
I've got a test table in 7.0.3 where I'm implementing a directory
type structure in a RCS type system. I have a check to ensure that
there are no duplicate filenames within for a specific directory
given the revisionid of 0 (means it's the current revision rather
than a historical one).
CREAT