File tree 2 files changed +10
-10
lines changed 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ drop rule qqq on copydml_test;
84
84
create function qqq_trig() returns trigger as $$
85
85
begin
86
86
if tg_op in ('INSERT', 'UPDATE') then
87
- raise notice '% %' , tg_op, new.id;
87
+ raise notice '% % %', tg_when , tg_op, new.id;
88
88
return new;
89
89
else
90
- raise notice '% %' , tg_op, old.id;
90
+ raise notice '% % %', tg_when , tg_op, old.id;
91
91
return old;
92
92
end if;
93
93
end
@@ -97,16 +97,16 @@ create trigger qqqbef before insert or update or delete on copydml_test
97
97
create trigger qqqaf after insert or update or delete on copydml_test
98
98
for each row execute procedure qqq_trig();
99
99
copy (insert into copydml_test (t) values ('f') returning id) to stdout;
100
- NOTICE: INSERT 8
100
+ NOTICE: BEFORE INSERT 8
101
101
8
102
- NOTICE: INSERT 8
102
+ NOTICE: AFTER INSERT 8
103
103
copy (update copydml_test set t = 'g' where t = 'f' returning id) to stdout;
104
- NOTICE: UPDATE 8
104
+ NOTICE: BEFORE UPDATE 8
105
105
8
106
- NOTICE: UPDATE 8
106
+ NOTICE: AFTER UPDATE 8
107
107
copy (delete from copydml_test where t = 'g' returning id) to stdout;
108
- NOTICE: DELETE 8
108
+ NOTICE: BEFORE DELETE 8
109
109
8
110
- NOTICE: DELETE 8
110
+ NOTICE: AFTER DELETE 8
111
111
drop table copydml_test;
112
112
drop function qqq_trig();
Original file line number Diff line number Diff line change @@ -70,10 +70,10 @@ drop rule qqq on copydml_test;
70
70
create function qqq_trig () returns trigger as $$
71
71
begin
72
72
if tg_op in (' INSERT' , ' UPDATE' ) then
73
- raise notice ' % %' , tg_op, new .id ;
73
+ raise notice ' % % % ' , tg_when , tg_op, new .id ;
74
74
return new;
75
75
else
76
- raise notice ' % %' , tg_op, old .id ;
76
+ raise notice ' % % % ' , tg_when , tg_op, old .id ;
77
77
return old;
78
78
end if;
79
79
end
You can’t perform that action at this time.
0 commit comments