summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/arrays.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/arrays.out')
-rw-r--r--src/test/regress/expected/arrays.out50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out
index c538fad621..804d52b798 100644
--- a/src/test/regress/expected/arrays.out
+++ b/src/test/regress/expected/arrays.out
@@ -1075,3 +1075,53 @@ select array_to_string(string_to_array('1|2|3', '|'), '|');
1|2|3
(1 row)
+select array_length(array[1,2,3], 1);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 0);
+ array_length
+--------------
+
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 1);
+ array_length
+--------------
+ 2
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 2);
+ array_length
+--------------
+ 3
+(1 row)
+
+select array_length(array[[1,2,3], [4,5,6]], 3);
+ array_length
+--------------
+
+(1 row)
+
+select cardinality(array[1,2,3]);
+ cardinality
+-------------
+ 3
+(1 row)
+
+select cardinality(array[[1,2,3], [4,5,6]]);
+ cardinality
+-------------
+ 2
+(1 row)
+
+select c, cardinality(c), d, cardinality(d) from arrtest;
+ c | cardinality | d | cardinality
+-------------------+-------------+---------------+-------------
+ {} | | {} |
+ {foobar,new_word} | 2 | {{elt1,elt2}} | 1
+ {foo,new_word} | 2 | {bar,foo} | 2
+(3 rows)
+