array_length() function, and for SQL compatibility also cardinality()
Peter Eisentraut <peter_e@gmx.net>
array_length() function, and for SQL compatibility also cardinality() function as a special case. This version still has the suspicious behavior of returning null for an empty array (rather than zero), but this may need a wholesale revision of empty array behavior, currently under discussion. Jim Nasby, Robert Haas, Peter Eisentraut
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/array.sgml | modified | +13 −1 |
| doc/src/sgml/func.sgml | modified | +25 −1 |
| src/backend/utils/adt/arrayfuncs.c | modified | +29 −1 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +5 −1 |
| src/include/utils/array.h | modified | +2 −1 |
| src/test/regress/expected/arrays.out | modified | +50 −0 |
| src/test/regress/sql/arrays.sql | modified | +9 −0 |