Revision 12433
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
957 | 957 |
|
958 | 958 |
|
959 | 959 |
-- |
960 |
-- Name: debug_print_return_value(anyelement); Type: FUNCTION; Schema: util; Owner: - |
|
960 |
-- Name: debug_print_return_value(anyelement, boolean); Type: FUNCTION; Schema: util; Owner: -
|
|
961 | 961 |
-- |
962 | 962 |
|
963 |
CREATE FUNCTION debug_print_return_value(value anyelement) RETURNS anyelement |
|
963 |
CREATE FUNCTION debug_print_return_value(value anyelement, encode boolean DEFAULT false) RETURNS anyelement
|
|
964 | 964 |
LANGUAGE sql IMMUTABLE |
965 | 965 |
AS $_$ |
966 |
SELECT util.raise_notice('returns: '||util.quote_typed($1)); |
|
966 |
SELECT util.raise_notice('returns: ' |
|
967 |
||(CASE WHEN $2 THEN util.quote_typed($1) ELSE $1::text END)); |
|
967 | 968 |
SELECT $1; |
968 | 969 |
$_$; |
969 | 970 |
|
Also available in: Unified diff
schemas/util.sql: debug_print_return_value(): don't '-encode the value by default, because text values usually look better without the '-escaping