|
26 | 26 | message = coalesce(message, 'Unhandled value'), |
27 | 27 | detail = coalesce(detail, coalesce(to_json(value), 'null'::json)::text), |
28 | 28 | hint = coalesce(hint, 'See value in detail as JSON'), |
29 | | - errcode = coalesce(errcode, 'raise_exception'), |
| 29 | + errcode = coalesce(errcode, 'raise_exception'/*ERRCODE_RAISE_EXCEPTION (P0001)*/), |
30 | 30 | column = coalesce("column", ''), |
31 | 31 | constraint = coalesce("constraint", ''), |
32 | 32 | table = coalesce("table", ''), |
|
36 | 36 | end; |
37 | 37 | $$; |
38 | 38 |
|
| 39 | +comment on function raise_exception( |
| 40 | + value anyelement, |
| 41 | + message text, |
| 42 | + detail text, |
| 43 | + hint text, |
| 44 | + errcode text, |
| 45 | + "column" text, |
| 46 | + "constraint" text, |
| 47 | + "table" text, |
| 48 | + "schema" text |
| 49 | +) is $$ |
| 50 | + Function to throwing an error for user value. |
| 51 | + Uses in SQL language. |
| 52 | + Wrapper for RAISE command with EXCEPTION level in PL/pgSQL language. |
| 53 | +$$; |
| 54 | + |
39 | 55 | --TEST FUNCTION |
40 | 56 | do $$ |
41 | 57 | DECLARE |
|
0 commit comments