@@ -13,7 +13,7 @@ create or replace function public.raise_exception(
1313 " table" text default null ,
1414 " column" text default null
1515)
16- returns boolean
16+ returns anyelement
1717 immutable
1818 -- strict -- returns null if any parameter is null
1919 parallel safe
3232 table = coalesce(" table" , ' ' ),
3333 column = coalesce(" column" , ' ' ),
3434 datatype = pg_typeof(value)::text ;
35- return null ::bool ;
35+ return null ::anyelement ;
3636end;
3737$$;
3838
@@ -133,7 +133,7 @@ left join generate_series(1, 4 + 1) as hand2(finger) using (finger)
133133where case when hand1 .finger between 1 and 5
134134 and hand2 .finger is not null
135135 then true
136- else public .raise_exception (array[hand1 .finger , hand2 .finger ])
136+ else public .raise_exception (array[hand1 .finger , hand2 .finger ]):: text ::bool
137137 end
138138order by hand1 .finger ;
139139
@@ -143,7 +143,7 @@ with t as materialized (
143143 from generate_series(1 , 100000 ) as x(i)
144144 where case when clock_timestamp() < ' 1s' + statement_timestamp()
145145 then true
146- else public .raise_exception (i)
146+ else public .raise_exception (i)::bool
147147 end
148148 order by i
149149)
@@ -161,4 +161,9 @@ WHERE
161161 table_name = ' source_1234567890' AND
162162 column_name = ' scope' ;
163163
164+ -- USE EXAMPLE 5
165+ SELECT CASE WHEN true THEN point (0 ,0 )
166+ ELSE public .raise_exception (null ::point )
167+ END;
168+ 164169-- See also: https://github.com/decibel/pgerror
0 commit comments