In DB for these values write NULL and in uk write NULLS NOT DISTINCT:
ALTER TABLE FOO ADD CONSTRAINT uk_foo UNIQUE NULLS NOT DISTINCT (parent_id , super_parent_id);