By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
create table foo (
id serial constraint foo_pk primary key,
a int,
b int
);
insert into foo (a,b) values (1, 1), (2, 2);
update foo t
set a = v.a::int, b = v.b
from (values (1, NULL, 1),(2, NULL, 2)) as v(id, a, b)
where v.id = t.id;
CREATE TABLE
INSERT 0 2
UPDATE 2
update foo t
set a = v.a::int, b = v.b
from (values (1, NULL::int, 1),(2, NULL, 2)) as v(id, a, b)
where v.id = t.id;
UPDATE 2