File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 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;
8484create function qqq_trig() returns trigger as $$
8585begin
8686if tg_op in ('INSERT', 'UPDATE') then
87- raise notice '% %' , tg_op, new.id;
87+ raise notice '% % %', tg_when , tg_op, new.id;
8888 return new;
8989else
90- raise notice '% %' , tg_op, old.id;
90+ raise notice '% % %', tg_when , tg_op, old.id;
9191 return old;
9292end if;
9393end
@@ -97,16 +97,16 @@ create trigger qqqbef before insert or update or delete on copydml_test
9797create trigger qqqaf after insert or update or delete on copydml_test
9898 for each row execute procedure qqq_trig();
9999copy (insert into copydml_test (t) values ('f') returning id) to stdout;
100- NOTICE: INSERT 8
100+ NOTICE: BEFORE INSERT 8
1011018
102- NOTICE: INSERT 8
102+ NOTICE: AFTER INSERT 8
103103copy (update copydml_test set t = 'g' where t = 'f' returning id) to stdout;
104- NOTICE: UPDATE 8
104+ NOTICE: BEFORE UPDATE 8
1051058
106- NOTICE: UPDATE 8
106+ NOTICE: AFTER UPDATE 8
107107copy (delete from copydml_test where t = 'g' returning id) to stdout;
108- NOTICE: DELETE 8
108+ NOTICE: BEFORE DELETE 8
1091098
110- NOTICE: DELETE 8
110+ NOTICE: AFTER DELETE 8
111111drop table copydml_test;
112112drop function qqq_trig();
Original file line number Diff line number Diff line change @@ -70,10 +70,10 @@ drop rule qqq on copydml_test;
7070create function qqq_trig () returns trigger as $$
7171begin
7272if tg_op in (' INSERT' , ' UPDATE' ) then
73- raise notice ' % %' , tg_op, new .id ;
73+ raise notice ' % % % ' , tg_when , tg_op, new .id ;
7474 return new;
7575else
76- raise notice ' % %' , tg_op, old .id ;
76+ raise notice ' % % % ' , tg_when , tg_op, old .id ;
7777 return old;
7878end if;
7979end
You can’t perform that action at this time.
0 commit comments