Revision 10322
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
847 | 847 |
|
848 | 848 |
|
849 | 849 |
-- |
850 |
-- Name: empty_array(anyelement); Type: FUNCTION; Schema: util; Owner: - |
|
851 |
-- |
|
852 |
|
|
853 |
CREATE FUNCTION empty_array(elem_type_null anyelement DEFAULT NULL::text) RETURNS anyarray |
|
854 |
LANGUAGE sql IMMUTABLE |
|
855 |
AS $_$ |
|
856 |
SELECT util.array_fill($1, 0) |
|
857 |
$_$; |
|
858 |
|
|
859 |
|
|
860 |
-- |
|
861 |
-- Name: FUNCTION empty_array(elem_type_null anyelement); Type: COMMENT; Schema: util; Owner: - |
|
862 |
-- |
|
863 |
|
|
864 |
COMMENT ON FUNCTION empty_array(elem_type_null anyelement) IS 'constructs proper empty 1-dimensional array whose dimensions are not NULL ( ''{}''::text[] does not do this)'; |
|
865 |
|
|
866 |
|
|
867 |
-- |
|
850 | 868 |
-- Name: ensure_prefix(text, text); Type: FUNCTION; Schema: util; Owner: - |
851 | 869 |
-- |
852 | 870 |
|
Also available in: Unified diff
schemas/util.sql: added empty_array(), for constructing proper empty 1-dimensional arrays whose dimensions are not NULL ( {}::text[] does not do this)