for (i = 0; i < MAXDIM; ++i)
{
- temp[i] = dim[i] = 0;
- nelems_last[i] = nelems[i] = 1;
+ temp[i] = dim[i] = nelems_last[i] = 0;
+ nelems[i] = 1;
}
ptr = str;
errmsg("malformed array literal: \"%s\"", str)));
nest_level--;
- if ((nelems_last[nest_level] != 1) &&
- (nelems[nest_level] != nelems_last[nest_level]))
+ if (nelems_last[nest_level] != 0 &&
+ nelems[nest_level] != nelems_last[nest_level])
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
errmsg("multidimensional arrays must have "
6
(1 row)
-select cardinality('{{{1}},{{2,3},{3,4}}}'::int[]);
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
cardinality
-------------
8
select cardinality('[2:4]={5,6,7}'::int[]);
select cardinality('{{1,2}}'::int[]);
select cardinality('{{1,2},{3,4},{5,6}}'::int[]);
-select cardinality('{{{1}},{{2,3},{3,4}}}'::int[]);
+select cardinality('{{{1,9},{5,6}},{{2,3},{3,4}}}'::int[]);
select array_agg(unique1) from (select unique1 from tenk1 where unique1 < 15 order by unique1) ss;
select array_agg(ten) from (select ten from tenk1 where unique1 < 15 order by unique1) ss;