22
33-- Documentation: https://postgrespro.ru/docs/postgresql/14/plpgsql-errors-and-messages
44
5- create or replace function raise_exception (
5+ create or replace function public . raise_exception(
66 value anyelement,
77 message text default ' Unhandled value' ,
88 detail text default null ,
3636end;
3737$$;
3838
39- comment on function raise_exception(
39+ comment on function public . raise_exception (
4040 value anyelement,
4141 message text ,
4242 detail text ,
@@ -69,23 +69,23 @@ do $$
6969 BEGIN
7070 i := i + 1 ;
7171 if i = 1 then
72- perform raise_exception(null ::int );
72+ perform public . raise_exception (null ::int );
7373 elsif i = 2 then
74- perform raise_exception(1234567890 , null );
74+ perform public . raise_exception (1234567890 , null );
7575 elsif i = 3 then
76- perform raise_exception(' ABCDE' ::text , null , null );
76+ perform public . raise_exception (' ABCDE' ::text , null , null );
7777 elsif i = 4 then
78- perform raise_exception(json_build_object(' id' , 123 ), null , null , null );
78+ perform public . raise_exception (json_build_object(' id' , 123 ), null , null , null );
7979 elsif i = 5 then
80- perform raise_exception(' 1d2h3m4s' ::interval, null , null , null , null );
80+ perform public . raise_exception (' 1d2h3m4s' ::interval, null , null , null , null );
8181 elsif i = 6 then
82- perform raise_exception(now(), null , null , null , null , null );
82+ perform public . raise_exception (now(), null , null , null , null , null );
8383 elsif i = 7 then
84- perform raise_exception(true, null , null , null , null , null , null );
84+ perform public . raise_exception (true, null , null , null , null , null , null );
8585 elsif i = 8 then
86- perform raise_exception(- 123 .456 , null , null , null , null , null , null , null );
86+ perform public . raise_exception (- 123 .456 , null , null , null , null , null , null , null );
8787 elsif i = 9 then
88- perform raise_exception(point (0 , 0 ), null , null , null , null , null , null , null , null );
88+ perform public . raise_exception (point (0 , 0 ), null , null , null , null , null , null , null , null );
8989 end if;
9090 EXIT WHEN true;
9191 EXCEPTION WHEN others THEN
@@ -117,7 +117,7 @@ select case finger
117117 when 3 then ' three'
118118 when 4 then ' four'
119119 when 5 then ' five'
120- else raise_exception(finger)::text
120+ else public . raise_exception (finger)::text
121121 end
122122from generate_series(1 , 5 ) as hand(finger);
123123
@@ -129,7 +129,7 @@ left join generate_series(1, 4 + 1) as hand2(finger) using (finger)
129129where case when hand1 .finger between 1 and 5
130130 and hand2 .finger is not null
131131 then true
132- else raise_exception(array[hand1 .finger , hand2 .finger ])
132+ else public . raise_exception (array[hand1 .finger , hand2 .finger ])
133133 end
134134order by hand1 .finger ;
135135
@@ -138,7 +138,7 @@ select i
138138from generate_series(1 , 300 ) as x(i)
139139where case when clock_timestamp() - statement_timestamp() < ' 1s'
140140 then true
141- else raise_exception(i)
141+ else public . raise_exception (i)
142142 end
143143order by i;
144144
0 commit comments