Raise exception when custom primary_key is given.