summaryrefslogtreecommitdiff
path: root/src/include/utils/array.h
diff options
context:
space:
mode:
authorRobert Haas2014-01-21 17:38:53 +0000
committerRobert Haas2014-01-21 17:38:53 +0000
commit01f7808b3eafcae1f6077f2f61e13b4c132ccd47 (patch)
tree744e328b7dddbdd7294e341f6165d58e51024cdd /src/include/utils/array.h
parent033b2343fae9d8c9df124cde62087dcb481c9c5e (diff)
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
Diffstat (limited to 'src/include/utils/array.h')
-rw-r--r--src/include/utils/array.h1
1 files changed, 1 insertions, 0 deletions
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);