As pozs commented on your post, you cannot put a restriction CHECKlike this in an array as far as I know (a real professional can fix me here).
, BEFORE INSERT, names . , a CONSTRAINT. , .
CREATE FUNCTION all_caps_array_only() RETURNS trigger AS $$
DECLARE
name varchar(40);
BEGIN
FOREACH name IN ARRAY NEW.names LOOP
IF name !~ '[A-Z]+' THEN
RETURN NULL;
END IF;
END LOOP;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;