aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/arrays.out
blob: b0869a9495065e80989e407f406b71b1c3222105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
QUERY: SELECT * FROM arrtest;
a          |b              |c            |d                |e            |f                |g              
-----------+---------------+-------------+-----------------+-------------+-----------------+---------------
{1,2,3,4,5}|{{{0,0},{1,2}}}|{}           |{}               |             |{}               |{}             
{11,12,23} |{{3,4},{4,5}}  |{"foobar"}   |{{"elt1","elt2"}}|{"3.4","6.7"}|{"abc  ","abcde"}|{"abc","abcde"}
{}         |{3,4}          |{"foo","bar"}|{"bar","foo"}    |             |                 |               
(3 rows)

QUERY: SELECT arrtest.a[1],
          arrtest.b[1][1][1],
          arrtest.c[1],
          arrtest.d[1][1],
          arrtest.e[0]
   FROM arrtest;
 a|b|c     |d   |e
--+-+------+----+-
 1|0|      |    | 
11| |foobar|elt1| 
  | |foo   |    | 
(3 rows)

QUERY: SELECT arrtest.a[1:3],
          arrtest.b[1:1][1:2][1:2],
          arrtest.c[1:2],
          arrtest.d[1:1][1:2]
   FROM arrtest;
a         |b              |c            |d                
----------+---------------+-------------+-----------------
{1,2,3}   |{{{0,0},{1,2}}}|             |                 
{11,12,23}|               |             |{{"elt1","elt2"}}
          |               |{"foo","bar"}|                 
(3 rows)

QUERY: SELECT array_dims(arrtest.b) AS x;
x              
---------------
[1:1][1:2][1:2]
[1:2][1:2]     
[1:2]          
(3 rows)

QUERY: SELECT *
   FROM arrtest
   WHERE arrtest.a[1] < 5 and
         arrtest.c = '{"foobar"}'::_name;
a|b|c|d|e|f|g
-+-+-+-+-+-+-
(0 rows)

QUERY: SELECT arrtest.a[1:3],
          arrtest.b[1:1][1:2][1:2],
          arrtest.c[1:2],
          arrtest.d[1:1][1:2]
   FROM arrtest;
a         |b              |c            |d                
----------+---------------+-------------+-----------------
{1,2,3}   |{{{0,0},{1,2}}}|             |                 
{11,12,23}|               |             |{{"elt1","elt2"}}
          |               |{"foo","bar"}|                 
(3 rows)