DO $$
DECLARE arreglo RECORD;
BEGIN

	FOR arreglo IN SELECT id  FROM users WHERE id NOT IN (SELECT users_id FROM users_to_profiles WHERE profiles_id = 4) loop
		INSERT INTO users_to_profiles (users_id,profiles_id) VALUES (arreglo.id,4);
	end loop;
END;
$$

