|
|
|
@ -2094,6 +2094,30 @@ NOTICE: trigger zzz on parted_trig_1_1 AFTER INSERT for ROW |
|
|
|
|
NOTICE: trigger bbb on parted_trig_2 AFTER INSERT for ROW |
|
|
|
|
NOTICE: trigger zzz on parted_trig_2 AFTER INSERT for ROW |
|
|
|
|
drop table parted_trig; |
|
|
|
|
-- Verify propagation of trigger arguments to partitions |
|
|
|
|
create table parted_trig (a int) partition by list (a); |
|
|
|
|
create table parted_trig1 partition of parted_trig for values in (1); |
|
|
|
|
create or replace function trigger_notice() returns trigger as $$ |
|
|
|
|
declare |
|
|
|
|
arg1 text = TG_ARGV[0]; |
|
|
|
|
arg2 integer = TG_ARGV[1]; |
|
|
|
|
begin |
|
|
|
|
raise notice 'trigger % on % % % for % args % %', |
|
|
|
|
TG_NAME, TG_TABLE_NAME, TG_WHEN, TG_OP, TG_LEVEL, arg1, arg2; |
|
|
|
|
return null; |
|
|
|
|
end; |
|
|
|
|
$$ language plpgsql; |
|
|
|
|
create trigger aaa after insert on parted_trig |
|
|
|
|
for each row execute procedure trigger_notice('quirky', 1); |
|
|
|
|
-- Verify propagation of trigger arguments to partitions attached after creating trigger |
|
|
|
|
create table parted_trig2 partition of parted_trig for values in (2); |
|
|
|
|
create table parted_trig3 (like parted_trig); |
|
|
|
|
alter table parted_trig attach partition parted_trig3 for values in (3); |
|
|
|
|
insert into parted_trig values (1), (2), (3); |
|
|
|
|
NOTICE: trigger aaa on parted_trig1 AFTER INSERT for ROW args quirky 1 |
|
|
|
|
NOTICE: trigger aaa on parted_trig2 AFTER INSERT for ROW args quirky 1 |
|
|
|
|
NOTICE: trigger aaa on parted_trig3 AFTER INSERT for ROW args quirky 1 |
|
|
|
|
drop table parted_trig; |
|
|
|
|
-- test irregular partitions (i.e., different column definitions), |
|
|
|
|
-- including that the WHEN clause works |
|
|
|
|
create function bark(text) returns bool language plpgsql immutable |
|
|
|
|