Функция plpgsql с циклом по таблице change_request
CREATE FUNCTION update_users() RETURNS text AS $$ DECLARE i RECORD; BEGIN FOR i IN SELECT * FROM change_request ORDER BY id LOOP UPDATE users SET email = i.email, age = i.age WHERE id = i.user_id; END LOOP; RETURN 'OK'; END; $$ LANGUAGE plpgsql; SELECT update_users(); drop FUNCTION update_users();