From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Add a cardinality function for arrays. |
Date: | 2014-01-21 17:42:08 |
Message-ID: | E1W5fKy-0003Ui-HK@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2014-01-21 21:34:52 | pgsql: Tweak parse location assignment for CURRENT_DATE and related con |
Previous Message | Robert Haas | 2014-01-21 16:57:03 | pgsql: Fix inadvertent semantics change in last patch to plug memory le |