case when $1 is null then raise exception 'Please enter $1'
when $2 is null then raise exception 'Please enter $2'
end;
它会起作用吗,请给我答案
最佳答案
据我所知,它不会。 case
运算符用于表达式分支,就像在返回值的单行语句中一样。对于更复杂的事情和引发异常,使用 if … then … end if;
。
关于postgresql - 案例陈述是否支持引发异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20186109/