Revision 10374
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1186 | 1186 |
CREATE FUNCTION map_nulls(nulls text[], value anyelement) RETURNS anyelement |
1187 | 1187 |
LANGUAGE sql IMMUTABLE |
1188 | 1188 |
AS $_$ |
1189 |
SELECT util._map(util.hstore($1, NULL) || '*=>*', $2)
|
|
1189 |
SELECT util._map(util.nulls_map($1), $2)
|
|
1190 | 1190 |
$_$; |
1191 | 1191 |
|
1192 | 1192 |
|
Also available in: Unified diff
schemas/util.sql: map_nulls(): use new nulls_map(). proper inlining (i.e. same runtime before and after change) has been verified with the following profiling query:
SELECT util.map_nulls(array[1, 2, 3]::text[], v) FROM unnest(array_fill(1, array100000)) f (v)