Revision 12560
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2492 | 2492 |
|
2493 | 2493 |
CREATE FUNCTION raise(type text, msg text) RETURNS void |
2494 | 2494 |
LANGUAGE sql IMMUTABLE |
2495 |
AS $_$ |
|
2495 |
AS $_X$
|
|
2496 | 2496 |
SELECT util.eval($$ |
2497 | 2497 |
CREATE OR REPLACE FUNCTION pg_temp.__raise() |
2498 | 2498 |
RETURNS void AS |
2499 |
$BODY1$ |
|
2499 |
-- $__BODY1$ in case msg contains $BODY1$ (in SQL) |
|
2500 |
$__BODY1$ |
|
2500 | 2501 |
BEGIN |
2501 | 2502 |
RAISE $$||$1||$$ USING MESSAGE = $$||quote_nullable($2)||$$; |
2502 | 2503 |
END; |
2503 |
$BODY1$ |
|
2504 |
$__BODY1$
|
|
2504 | 2505 |
LANGUAGE plpgsql IMMUTABLE |
2505 | 2506 |
COST 100; |
2506 | 2507 |
$$, verbose_ := false); |
2507 | 2508 |
|
2508 | 2509 |
SELECT util.eval($$SELECT pg_temp.__raise()$$, verbose_ := false); |
2509 |
$_$; |
|
2510 |
$_X$;
|
|
2510 | 2511 |
|
2511 | 2512 |
|
2512 | 2513 |
-- |
Also available in: Unified diff
bugfix: schemas/util.sql: raise(): need to use $__BODY1$ in case msg contains $BODY1$ (in SQL)