-- check that "do nothing" BR triggers work with tuple-routing (this checks
-- that estate->es_result_relation_info is appropriately set/reset for each
-- routed tuple)
-create table donothingbrtrig_test (a int, b text) partition by list (a);
-create table donothingbrtrig_test1 (b text, a int);
-create table donothingbrtrig_test2 (c text, b text, a int);
+create table donothingbrtrig_test (a int, b text) partition by list (a) distributed by (a);
+create table donothingbrtrig_test1 (a int, b text) distributed by (a);
+create table donothingbrtrig_test2 (a int, b text, c text) distributed by (a);
alter table donothingbrtrig_test2 drop column c;
create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+ERROR: Postgres-XL does not support TRIGGER yet
+DETAIL: The feature is not currently supported
create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+ERROR: Postgres-XL does not support TRIGGER yet
+DETAIL: The feature is not currently supported
alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
insert into donothingbrtrig_test values (1, 'foo'), (2, 'bar');
-NOTICE: b: foo
-NOTICE: b: bar
copy donothingbrtrig_test from stdout;
-NOTICE: b: baz
-NOTICE: b: qux
select tableoid::regclass, * from donothingbrtrig_test;
- tableoid | a | b
-----------+---+---
-(0 rows)
+ tableoid | a | b
+-----------------------+---+-----
+ donothingbrtrig_test1 | 1 | foo
+ donothingbrtrig_test1 | 1 | baz
+ donothingbrtrig_test2 | 2 | bar
+ donothingbrtrig_test2 | 2 | qux
+(4 rows)
-- cleanup
drop table donothingbrtrig_test;
-- check that "do nothing" BR triggers work with tuple-routing (this checks
-- that estate->es_result_relation_info is appropriately set/reset for each
-- routed tuple)
-create table donothingbrtrig_test (a int, b text) partition by list (a);
-create table donothingbrtrig_test1 (b text, a int);
-create table donothingbrtrig_test2 (c text, b text, a int);
+create table donothingbrtrig_test (a int, b text) partition by list (a) distributed by (a);
+create table donothingbrtrig_test1 (a int, b text) distributed by (a);
+create table donothingbrtrig_test2 (a int, b text, c text) distributed by (a);
alter table donothingbrtrig_test2 drop column c;
create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();