Project

General

Profile

« Previous | Next » 

Revision 10325

schemas/util.sql: added map_nulls(), a common use case of _map()

View differences:

schemas/util.sql
1097 1097

  
1098 1098

  
1099 1099
--
1100
-- Name: map_nulls(text[], text); Type: FUNCTION; Schema: util; Owner: -
1101
--
1102

  
1103
CREATE FUNCTION map_nulls(nulls text[], value text) RETURNS text
1104
    LANGUAGE sql IMMUTABLE STRICT
1105
    SET search_path TO util
1106
    AS $_$
1107
SELECT _map(($1 => NULL) || '*=>*', $2)
1108
$_$;
1109

  
1110

  
1111
--
1100 1112
-- Name: map_values(regclass); Type: FUNCTION; Schema: util; Owner: -
1101 1113
--
1102 1114

  

Also available in: Unified diff