Add width_bucket(anyelement, anyarray).
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +24 −9 |
| src/backend/utils/adt/arrayfuncs.c | modified | +243 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.h | modified | +4 −2 |
| src/include/utils/array.h | modified | +1 −0 |
| src/test/regress/expected/arrays.out | modified | +123 −0 |
| src/test/regress/sql/arrays.sql | modified | +62 −0 |