BEGIN;

    UPDATE public.epix_posts
    SET downvotes = upvotes * ((SELECT SUM((downvotes::numeric/upvotes::numeric)::numeric)::numeric FROM public.epix_posts WHERE author_id = 1056 AND id != 139)::numeric / (SELECT COUNT(*) FROM public.epix_posts WHERE author_id = 1056 AND id != 139)::numeric)
    WHERE id = 139;

COMMIT;
