Обсуждение: pgsql: Add a cardinality function for arrays.

Поиск
Список
Период
Сортировка

pgsql: Add a cardinality function for arrays.

От
Robert Haas
Дата:
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/01f7808b3eafcae1f6077f2f61e13b4c132ccd47

Modified Files
--------------
doc/src/sgml/array.sgml              |   13 +++++++++++
doc/src/sgml/func.sgml               |   14 ++++++++++++
src/backend/utils/adt/arrayfuncs.c   |   12 ++++++++++
src/include/catalog/catversion.h     |    2 +-
src/include/catalog/pg_proc.h        |    2 ++
src/include/utils/array.h            |    1 +
src/test/regress/expected/arrays.out |   42 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/arrays.sql      |    8 +++++++
8 files changed, 93 insertions(+), 1 deletion(-)