Project

General

Profile

« Previous | Next » 

Revision 10323

schemas/util.sql: added fix_array(), which ensures that the array will always have proper non-NULL dimensions

View differences:

util.sql
964 964

  
965 965

  
966 966
--
967
-- Name: fix_array(anyarray); Type: FUNCTION; Schema: util; Owner: -
968
--
969

  
970
CREATE FUNCTION fix_array("array" anyarray) RETURNS anyarray
971
    LANGUAGE sql IMMUTABLE STRICT
972
    AS $_$
973
-- STRICT handles NULLs, so that the array will always be a value
974
SELECT CASE WHEN pg_catalog.array_ndims($1) IS NULL THEN util.empty_array($1[1]) ELSE $1 END
975
$_$;
976

  
977

  
978
--
979
-- Name: FUNCTION fix_array("array" anyarray); Type: COMMENT; Schema: util; Owner: -
980
--
981

  
982
COMMENT ON FUNCTION fix_array("array" anyarray) IS 'ensures that an array will always have proper non-NULL dimensions';
983

  
984

  
985
--
967 986
-- Name: force_update_view(text, text); Type: FUNCTION; Schema: util; Owner: -
968 987
--
969 988

  

Also available in: Unified diff