@@ -1125,22 +1125,22 @@ select c, cardinality(c), d, cardinality(d) from arrtest;
11251125 {foo,new_word} | 2 | {bar,foo} | 2
11261126(3 rows)
11271127
1128- select array_agg(unique1) from tenk1 where unique1 < 15;
1128+ select array_agg(unique1) from(select unique1 from tenk1 where unique1 < 15 order by unique1) ss ;
11291129 array_agg
11301130--------------------------------------
1131- {4,2,1,6,14,9,8,5,3,13 ,12,11,7,10,0 }
1131+ {0,1,2,3,4,5,6,7,8,9,10,11 ,12,13,14 }
11321132(1 row)
11331133
1134- select array_agg(ten) from tenk1 where unique1 < 15;
1134+ select array_agg(ten) from(select ten from tenk1 where unique1 < 15 order by unique1) ss ;
11351135 array_agg
11361136---------------------------------
1137- {4,2,1,6,4,9,8,5,3,3,2 ,1,7,0,0 }
1137+ {0,1,2,3,4,5,6,7,8,9,0 ,1,2,3,4 }
11381138(1 row)
11391139
1140- select array_agg(nullif(ten, 4)) from tenk1 where unique1 < 15;
1140+ select array_agg(nullif(ten, 4)) from(select ten from tenk1 where unique1 < 15 order by unique1) ss ;
11411141 array_agg
11421142---------------------------------------
1143- {NULL,2,1,6, NULL,9,8,5,3,3,2 ,1,7,0,0 }
1143+ {0,1,2,3, NULL,5,6,7,8,9,0 ,1,2,3,NULL }
11441144(1 row)
11451145
11461146select cardinality(array_agg(unique1)) from tenk1 where unique1 < 15;
@@ -1149,12 +1149,6 @@ select cardinality(array_agg(unique1)) from tenk1 where unique1 < 15;
11491149 15
11501150(1 row)
11511151
1152- select array_agg(unique1) from (select * from tenk1 order by unique1 asc) as tab where unique1 < 15;
1153- array_agg
1154- --------------------------------------
1155- {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}
1156- (1 row)
1157-
11581152select array_agg(unique1) from tenk1 where unique1 < -15;
11591153 array_agg
11601154-----------