From 01f7808b3eafcae1f6077f2f61e13b4c132ccd47 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 21 Jan 2014 12:38:53 -0500 Subject: Add a cardinality function for arrays. Unlike our other array functions, this considers the total number of elements across all dimensions, and returns 0 rather than NULL when the array has no elements. But it seems that both of those behaviors are almost universally disliked, so hopefully that's OK. Marko Tiikkaja, reviewed by Dean Rasheed and Pavel Stehule --- src/include/utils/array.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/utils/array.h') diff --git a/src/include/utils/array.h b/src/include/utils/array.h index f6135a6cbb6..9bbfaae85ef 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -204,6 +204,7 @@ extern Datum array_dims(PG_FUNCTION_ARGS); extern Datum array_lower(PG_FUNCTION_ARGS); extern Datum array_upper(PG_FUNCTION_ARGS); extern Datum array_length(PG_FUNCTION_ARGS); +extern Datum array_cardinality(PG_FUNCTION_ARGS); extern Datum array_larger(PG_FUNCTION_ARGS); extern Datum array_smaller(PG_FUNCTION_ARGS); extern Datum generate_subscripts(PG_FUNCTION_ARGS); -- cgit v1.2.3