Implement the width_bucket() function, per SQL2003. This commit only adds
Neil Conway <neilc@samurai.com>
Implement the width_bucket() function, per SQL2003. This commit only adds a variant of the function for the 'numeric' datatype; it would be possible to add additional variants for other datatypes, but I haven't done so yet. This commit includes regression tests and minimal documentation; if we want developers to actually use this function in applications, we'll probably need to document what it does more fully.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/errcodes.sgml | modified | +6 −1 |
| doc/src/sgml/func.sgml | modified | +11 −1 |
| doc/src/sgml/xfunc.sgml | modified | +8 −8 |
| src/backend/utils/adt/numeric.c | modified | +141 −8 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +3 −1 |
| src/include/utils/builtins.h | modified | +2 −1 |
| src/include/utils/errcodes.h | modified | +2 −1 |
| src/test/regress/expected/numeric.out | modified | +51 −0 |
| src/test/regress/sql/numeric.sql | modified | +46 −0 |