diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 5ed691c2e3..ac1cc51cb4 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -1728,6 +1728,7 @@ inheritance_planner(PlannerInfo *root) subpaths = list_make1(dummy_path); subroots = list_make1(root); resultRelations = list_make1_int(parse->resultRelation); + nominalRelation = parse->resultRelation; if (parse->withCheckOptions) withCheckOptionLists = list_make1(parse->withCheckOptions); if (parse->returningList) diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out index c6abcfc3cb..1a8cbd4e6f 100644 --- a/src/test/regress/expected/inherit.out +++ b/src/test/regress/expected/inherit.out @@ -545,27 +545,25 @@ create table some_tab_child () inherits (some_tab); insert into some_tab_child values(1,2); explain (verbose, costs off) update some_tab set a = a + 1 where false; - QUERY PLAN ----------------------------------- + QUERY PLAN +------------------------------------------------------------- Update on public.some_tab - Update on public.some_tab -> Result - Output: (a + 1), b, ctid + Output: (some_tab.a + 1), some_tab.b, some_tab.ctid One-Time Filter: false -(5 rows) +(4 rows) update some_tab set a = a + 1 where false; explain (verbose, costs off) update some_tab set a = a + 1 where false returning b, a; - QUERY PLAN ----------------------------------- + QUERY PLAN +------------------------------------------------------------- Update on public.some_tab - Output: b, a - Update on public.some_tab + Output: some_tab.b, some_tab.a -> Result - Output: (a + 1), b, ctid + Output: (some_tab.a + 1), some_tab.b, some_tab.ctid One-Time Filter: false -(6 rows) +(5 rows) update some_tab set a = a + 1 where false returning b, a; b | a