]> granicus.if.org Git - postgresql/blob - src/test/regress/expected/arrays.out
92cfc94d2139b592fac1f5aab2eeb5f5b6c2e065
[postgresql] / src / test / regress / expected / arrays.out
1 QUERY: SELECT * FROM arrtest;
2 a          |b              |c            |d                |e            
3 -----------+---------------+-------------+-----------------+-------------
4 {1,2,3,4,5}|{{{0,0},{1,2}}}|{}           |{}               |             
5 {11,12,23} |{{3,4},{4,5}}  |{"foobar"}   |{{"elt1","elt2"}}|{"3.4","6.7"}
6 {}         |{3,4}          |{"foo","bar"}|{"bar","foo"}    |             
7 (3 rows)
8
9 QUERY: SELECT arrtest.a[1],
10           arrtest.b[1][1][1],
11           arrtest.c[1],
12           arrtest.d[1][1],
13           arrtest.e[0]
14    FROM arrtest;
15  a|b|c     |d   |e
16 --+-+------+----+-
17  1|0|      |    | 
18 11| |foobar|elt1| 
19   | |foo   |    | 
20 (3 rows)
21
22 QUERY: SELECT arrtest.a[1:3],
23           arrtest.b[1:1][1:2][1:2],
24           arrtest.c[1:2],
25           arrtest.d[1:1][1:2]
26    FROM arrtest;
27 a         |b              |c            |d                
28 ----------+---------------+-------------+-----------------
29 {1,2,3}   |{{{0,0},{1,2}}}|             |                 
30 {11,12,23}|               |             |{{"elt1","elt2"}}
31           |               |{"foo","bar"}|                 
32 (3 rows)
33
34 QUERY: SELECT array_dims(arrtest.b) AS x;
35 x              
36 ---------------
37 [1:1][1:2][1:2]
38 [1:2][1:2]     
39 [1:2]          
40 (3 rows)
41
42 QUERY: SELECT *
43    FROM arrtest
44    WHERE arrtest.a[1] < 5 and
45          arrtest.c = '{"foobar"}'::_name;
46 a|b|c|d|e
47 -+-+-+-+-
48 (0 rows)
49
50 QUERY: SELECT arrtest.a[1:3],
51           arrtest.b[1:1][1:2][1:2],
52           arrtest.c[1:2],
53           arrtest.d[1:1][1:2]
54    FROM arrtest;
55 a         |b              |c            |d                
56 ----------+---------------+-------------+-----------------
57 {1,2,3}   |{{{0,0},{1,2}}}|             |                 
58 {11,12,23}|               |             |{{"elt1","elt2"}}
59           |               |{"foo","bar"}|                 
60 (3 rows)
61