Skip to content

Commit 44a184c

Browse files
committed
Use the non-deprecated TG_TABLE_MAME in test trigger
Commit 3a9ae3d (back in 2006) deprecated TG_RELNAME in favor of TG_TABLE_NAME, but the existing usage in test cases has remained till today. Change to use TG_TABLE_NAME instead (TG_RELNAME is still covered by a test case).
1 parent 13cfa02 commit 44a184c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/regress/expected/triggers.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ create table trigtest (i serial primary key);
701701
create table trigtest2 (i int references trigtest(i) on delete cascade);
702702
create function trigtest() returns trigger as $$
703703
begin
704-
raise notice '% % % %', TG_RELNAME, TG_OP, TG_WHEN, TG_LEVEL;
704+
raise notice '% % % %', TG_TABLE_NAME, TG_OP, TG_WHEN, TG_LEVEL;
705705
return new;
706706
end;$$ language plpgsql;
707707
create trigger trigtest_b_row_tg before insert or update or delete on trigtest
@@ -987,7 +987,7 @@ begin
987987
argstr := argstr || TG_argv[i];
988988
end loop;
989989

990-
raise notice '% % % % (%)', TG_RELNAME, TG_WHEN, TG_OP, TG_LEVEL, argstr;
990+
raise notice '% % % % (%)', TG_TABLE_NAME, TG_WHEN, TG_OP, TG_LEVEL, argstr;
991991

992992
if TG_LEVEL = 'ROW' then
993993
if TG_OP = 'INSERT' then

src/test/regress/sql/triggers.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ create table trigtest2 (i int references trigtest(i) on delete cascade);
444444

445445
create function trigtest() returns trigger as $$
446446
begin
447-
raise notice '% % % %', TG_RELNAME, TG_OP, TG_WHEN, TG_LEVEL;
447+
raise notice '% % % %', TG_TABLE_NAME, TG_OP, TG_WHEN, TG_LEVEL;
448448
return new;
449449
end;$$ language plpgsql;
450450

@@ -680,7 +680,7 @@ begin
680680
argstr := argstr || TG_argv[i];
681681
end loop;
682682

683-
raise notice '% % % % (%)', TG_RELNAME, TG_WHEN, TG_OP, TG_LEVEL, argstr;
683+
raise notice '% % % % (%)', TG_TABLE_NAME, TG_WHEN, TG_OP, TG_LEVEL, argstr;
684684

685685
if TG_LEVEL = 'ROW' then
686686
if TG_OP = 'INSERT' then

0 commit comments

Comments
 (0)