Project

General

Profile

« Previous | Next » 

Revision 10304

schemas/util.sql: added array_length(anyarray, dimension integer) wrapper, which returns 0 instead of NULL for empty arrays

View differences:

schemas/util.sql
546 546

  
547 547

  
548 548
--
549
-- Name: array_length(anyarray, integer); Type: FUNCTION; Schema: util; Owner: -
550
--
551

  
552
CREATE FUNCTION array_length("array" anyarray, dimension integer) RETURNS integer
553
    LANGUAGE sql IMMUTABLE STRICT
554
    AS $_$
555
SELECT COALESCE(pg_catalog.array_length($1, $2), 0)
556
$_$;
557

  
558

  
559
--
560
-- Name: FUNCTION array_length("array" anyarray, dimension integer); Type: COMMENT; Schema: util; Owner: -
561
--
562

  
563
COMMENT ON FUNCTION array_length("array" anyarray, dimension integer) IS 'returns 0 instead of NULL for empty arrays';
564

  
565

  
566
--
549 567
-- Name: cluster_index(regclass); Type: FUNCTION; Schema: util; Owner: -
550 568
--
551 569

  

Also available in: Unified diff