Skip to content

Commit b3a9e98

Browse files
committed
Extend a test case a little
This will possibly help a subsequent patch by making sure the notice messages are distinct so that it's clear that they come out in the right order. Author: Fabien COELHO <coelho@cri.ensmp.fr> Discussion: https://www.postgresql.org/message-id/alpine.DEB.2.21.1904240654120.3407%40lancre
1 parent 329784e commit b3a9e98

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/test/regress/expected/copydml.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ drop rule qqq on copydml_test;
8484
create function qqq_trig() returns trigger as $$
8585
begin
8686
if 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;
8989
else
90-
raise notice '% %', tg_op, old.id;
90+
raise notice '% % %', tg_when, tg_op, old.id;
9191
return old;
9292
end if;
9393
end
@@ -97,16 +97,16 @@ create trigger qqqbef before insert or update or delete on copydml_test
9797
create trigger qqqaf after insert or update or delete on copydml_test
9898
for each row execute procedure qqq_trig();
9999
copy (insert into copydml_test (t) values ('f') returning id) to stdout;
100-
NOTICE: INSERT 8
100+
NOTICE: BEFORE INSERT 8
101101
8
102-
NOTICE: INSERT 8
102+
NOTICE: AFTER INSERT 8
103103
copy (update copydml_test set t = 'g' where t = 'f' returning id) to stdout;
104-
NOTICE: UPDATE 8
104+
NOTICE: BEFORE UPDATE 8
105105
8
106-
NOTICE: UPDATE 8
106+
NOTICE: AFTER UPDATE 8
107107
copy (delete from copydml_test where t = 'g' returning id) to stdout;
108-
NOTICE: DELETE 8
108+
NOTICE: BEFORE DELETE 8
109109
8
110-
NOTICE: DELETE 8
110+
NOTICE: AFTER DELETE 8
111111
drop table copydml_test;
112112
drop function qqq_trig();

src/test/regress/sql/copydml.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ drop rule qqq on copydml_test;
7070
create function qqq_trig() returns trigger as $$
7171
begin
7272
if 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;
7575
else
76-
raise notice '% %', tg_op, old.id;
76+
raise notice '% % %', tg_when, tg_op, old.id;
7777
return old;
7878
end if;
7979
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy