A check constraint cannot contain a subquery or a procedure. Subqueries are disallowed in check constraints because they depend on the state of the database. For data integrity, the evaluation of a check constraint must not vary or depend on the state of the database.
Example of error:
CREATE TABLE new_stock ( stock_num SERIAL PRIMARY KEY, unit_price MONEY CHECK (unit_price >= (SELECT unit_price FROM stock WHERE manu_code = 'HRO')), manu_code CHAR(3));
Verify that your statement does not have a subquery or procedure in a check constraint.