From e80252d424278abf65b624669c8e6b3fe8587cac Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 9 Sep 2014 15:34:10 -0400 Subject: Add width_bucket(anyelement, anyarray). This provides a convenient method of classifying input values into buckets that are not necessarily equal-width. It works on any sortable data type. The choice of function name is a bit debatable, perhaps, but showing that there's a relationship to the SQL standard's width_bucket() function seems more attractive than the other proposals. Petr Jelinek, reviewed by 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 9bbfaae85ef..e744314c51b 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -214,6 +214,7 @@ extern Datum array_fill_with_lower_bounds(PG_FUNCTION_ARGS); extern Datum array_unnest(PG_FUNCTION_ARGS); extern Datum array_remove(PG_FUNCTION_ARGS); extern Datum array_replace(PG_FUNCTION_ARGS); +extern Datum width_bucket_array(PG_FUNCTION_ARGS); extern Datum array_ref(ArrayType *array, int nSubscripts, int *indx, int arraytyplen, int elmlen, bool elmbyval, char elmalign, -- cgit v1.2.3