Hi Tender Wang, I can reproduce this on master, and the fix looks right to me.
With `missing_ok = true`, a child-only column just gets a 0 in the map, and if an expression ever referenced it, `map_variable_attnos()` would raise "unexpected varattno" instead of mis-mapping it. ExecGetRootToChildMap() also passes missing_ok = true for non-partition children, for the same reason: /* * When this child table is not a partition (!relispartition), it may * have columns that are not present in the root table, which we ask * to ignore by passing true for missing_ok. */ I also tried whole-row RETURNING (t, t.*, old/new), RLS as a non-superuser, and a child with a dropped column. All work fine with the patch. Zhenglong Li, Regards
