From 6b29f5dcea045ef30967d91c071067361f08f832 Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Fri, 7 Jul 2017 20:12:03 +0200 Subject: [PATCH] Add missing block of expected output to inherit test The expected output of 'inherit' regression test was missing a whole block of code, likely due to incorrect resolution of merge conflict. Add the missing piece, copied from upstream. --- src/test/regress/expected/inherit.out | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out index dd0c3d1eaf..8fcd39a0dc 100644 --- a/src/test/regress/expected/inherit.out +++ b/src/test/regress/expected/inherit.out @@ -819,6 +819,45 @@ from ( select f1 from foo union all select f1+3 from foo ) ss where bar.f1 = ss.f1; --select tableoid::regclass::text as relname, bar.* from bar order by 1,2; +-- Check UPDATE with *partitioned* inherited target and an appendrel subquery +create table some_tab (a int); +insert into some_tab values (0); +create table some_tab_child () inherits (some_tab); +insert into some_tab_child values (1); +create table parted_tab (a int, b char) partition by list (a); +create table parted_tab_part1 partition of parted_tab for values in (1); +create table parted_tab_part2 partition of parted_tab for values in (2); +create table parted_tab_part3 partition of parted_tab for values in (3); +insert into parted_tab values (1, 'a'), (2, 'a'), (3, 'a'); +update parted_tab set b = 'b' +from + (select a from some_tab union all select a+1 from some_tab) ss (a) +where parted_tab.a = ss.a; +select tableoid::regclass::text as relname, parted_tab.* from parted_tab order by 1,2; + relname | a | b +------------------+---+--- + parted_tab_part1 | 1 | b + parted_tab_part2 | 2 | b + parted_tab_part3 | 3 | a +(3 rows) + +truncate parted_tab; +insert into parted_tab values (1, 'a'), (2, 'a'), (3, 'a'); +update parted_tab set b = 'b' +from + (select 0 from parted_tab union all select 1 from parted_tab) ss (a) +where parted_tab.a = ss.a; +select tableoid::regclass::text as relname, parted_tab.* from parted_tab order by 1,2; + relname | a | b +------------------+---+--- + parted_tab_part1 | 1 | b + parted_tab_part2 | 2 | a + parted_tab_part3 | 3 | a +(3 rows) + +drop table parted_tab; +drop table some_tab cascade; +NOTICE: drop cascades to table some_tab_child /* Test multiple inheritance of column defaults */ CREATE TABLE firstparent (tomorrow date default now()::date + 1); CREATE TABLE secondparent (tomorrow date default now() :: date + 1); -- 2.39.5