Revision 12536
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2520 | 2520 |
|
2521 | 2521 |
|
2522 | 2522 |
-- |
2523 |
-- Name: raise_error_notice(text); Type: FUNCTION; Schema: util; Owner: -
|
|
2523 |
-- Name: raise_error_warning(text); Type: FUNCTION; Schema: util; Owner: -
|
|
2524 | 2524 |
-- |
2525 | 2525 |
|
2526 |
CREATE FUNCTION raise_error_notice(msg text) RETURNS void
|
|
2526 |
CREATE FUNCTION raise_error_warning(msg text) RETURNS void
|
|
2527 | 2527 |
LANGUAGE sql IMMUTABLE |
2528 | 2528 |
AS $_$ |
2529 |
SELECT util.raise('NOTICE', 'ERROR: '||$1)
|
|
2529 |
SELECT util.raise('WARNING', 'ERROR: '||$1)
|
|
2530 | 2530 |
$_$; |
2531 | 2531 |
|
2532 | 2532 |
|
trunk/schemas/vegbien.sql | ||
---|---|---|
2131 | 2131 |
EXCEPTION |
2132 | 2132 |
WHEN OTHERS THEN |
2133 | 2133 |
errors_ct = errors_ct+1; |
2134 |
PERFORM util.raise_error_notice(SQLERRM);
|
|
2134 |
PERFORM util.raise_error_warning(SQLERRM);
|
|
2135 | 2135 |
END; |
2136 | 2136 |
END LOOP; |
2137 | 2137 |
IF errors_ct > 0 THEN |
2138 | 2138 |
-- can't raise exception because this would roll back the transaction |
2139 |
PERFORM util.raise_error_notice(errors_ct
|
|
2139 |
PERFORM util.raise_error_warning(errors_ct
|
|
2140 | 2140 |
||' queries had errors. please see the NOTICEs for details.'); |
2141 | 2141 |
END IF; |
2142 | 2142 |
END; |
Also available in: Unified diff
schemas/util.sql: raise_error_notice(): raise a WARNING instead because this is for errors, and rename to raise_error_warning() to match