1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

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
This commit is contained in:
Peter Eisentraut
2008-11-12 13:09:28 +00:00
parent 4c22564471
commit f98f6ee064
8 changed files with 135 additions and 7 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.67 2008/10/29 11:24:52 petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.68 2008/11/12 13:09:27 petere Exp $ -->
<sect1 id="arrays">
<title>Arrays</title>
@ -324,6 +324,18 @@ SELECT array_upper(schedule, 1) FROM sal_emp WHERE name = 'Carol';
-------------
2
(1 row)
</programlisting>
<function>array_length</function> will return the length of a specified
array dimension:
<programlisting>
SELECT array_length(schedule, 1) FROM sal_emp WHERE name = 'Carol';
array_length
--------------
2
(1 row)
</programlisting>
</para>
</sect2>