Commit 6ce5e0ab authored by Tom Lane's avatar Tom Lane

Update arrays regress test to reflect fact that several things

work now that did not work in 6.5.
parent 2a1bfbce
QUERY: SELECT * FROM arrtest; --
a |b |c |d |e |f |g -- ARRAYS
-----------+---------------+-------------+-----------------+-------------+-----------------+--------------- --
{1,2,3,4,5}|{{{0,0},{1,2}}}|{} |{} | |{} |{} SELECT * FROM arrtest;
{11,12,23} |{{3,4},{4,5}} |{"foobar"} |{{"elt1","elt2"}}|{"3.4","6.7"}|{"abc ","abcde"}|{"abc","abcde"} a | b | c | d | e | f | g
{} |{3,4} |{"foo","bar"}|{"bar","foo"} | | | -------------+-----------------+---------------+-------------------+---------------+-------------------+-----------------
{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) (3 rows)
QUERY: SELECT arrtest.a[1], SELECT arrtest.a[1],
arrtest.b[1][1][1], arrtest.b[1][1][1],
arrtest.c[1], arrtest.c[1],
arrtest.d[1][1], arrtest.d[1][1],
arrtest.e[0] arrtest.e[0]
FROM arrtest; FROM arrtest;
a|b|c |d |e a | b | c | d | e
--+-+------+----+- ----+---+--------+------+---
1|0| | | 1 | 0 | | |
11| |foobar|elt1| 11 | | foobar | elt1 |
| |foo | | | | foo | |
(3 rows) (3 rows)
QUERY: SELECT arrtest.a[1:3], SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
arrtest.b[1:1][1:2][1:2],
arrtest.c[1:2],
arrtest.d[1:1][1:2]
FROM arrtest; FROM arrtest;
a |b |c |d a | b | c | d | e
----------+---------------+-------------+----------------- ----+---+--------+------+---
{1,2,3} |{{{0,0},{1,2}}}| | 1 | 0 | | |
{11,12,23}| | |{{"elt1","elt2"}} 11 | | foobar | elt1 |
| |{"foo","bar"}| | | foo | |
(3 rows) (3 rows)
QUERY: SELECT array_dims(arrtest.b) AS x; SELECT a[1:3],
x b[1:1][1:2][1:2],
--------------- c[1:2],
[1:1][1:2][1:2] d[1:1][1:2]
[1:2][1:2] FROM arrtest;
[1:2] a | b | c | d
------------+-----------------+---------------+-------------------
{1,2,3} | {{{0,0},{1,2}}} | |
{11,12,23} | | | {{"elt1","elt2"}}
| | {"foo","bar"} |
(3 rows)
-- returns three different results--
SELECT array_dims(arrtest.b) AS x;
x
-----------------
[1:1][1:2][1:2]
[1:2][1:2]
[1:2]
(3 rows) (3 rows)
QUERY: SELECT * -- returns nothing
SELECT *
FROM arrtest FROM arrtest
WHERE arrtest.a[1] < 5 and WHERE a[1] < 5 and
arrtest.c = '{"foobar"}'::_name; c = '{"foobar"}'::_name;
a|b|c|d|e|f|g a | b | c | d | e | f | g
-+-+-+-+-+-+- ---+---+---+---+---+---+---
(0 rows) (0 rows)
QUERY: SELECT arrtest.a[1:3], UPDATE arrtest
arrtest.b[1:1][1:2][1:2], SET a[1:2] = '{16,25}',
arrtest.c[1:2], b[1:1][1:1][1:2] = '{113, 117}',
arrtest.d[1:1][1:2] c[1:1] = '{"new_word"}';
SELECT a[1:3],
b[1:1][1:2][1:2],
c[1:2],
d[1:1][2:2]
FROM arrtest; FROM arrtest;
a |b |c |d a | b | c | d
----------+---------------+-------------+----------------- ------------+---------------------+--------------------+------------
{1,2,3} |{{{0,0},{1,2}}}| | {16,25,3} | {{{113,117},{1,2}}} | |
{11,12,23}| | |{{"elt1","elt2"}} {16,25,23} | | | {{"elt2"}}
| |{"foo","bar"}| | | {"new_word","bar"} |
(3 rows) (3 rows)
...@@ -10,14 +10,14 @@ SELECT arrtest.a[1], ...@@ -10,14 +10,14 @@ SELECT arrtest.a[1],
arrtest.d[1][1], arrtest.d[1][1],
arrtest.e[0] arrtest.e[0]
FROM arrtest; FROM arrtest;
-- ??? what about
-- SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
-- FROM arrtest; FROM arrtest;
SELECT arrtest.a[1:3], SELECT a[1:3],
arrtest.b[1:1][1:2][1:2], b[1:1][1:2][1:2],
arrtest.c[1:2], c[1:2],
arrtest.d[1:1][1:2] d[1:1][1:2]
FROM arrtest; FROM arrtest;
-- returns three different results-- -- returns three different results--
...@@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x; ...@@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x;
-- returns nothing -- returns nothing
SELECT * SELECT *
FROM arrtest FROM arrtest
WHERE arrtest.a[1] < 5 and WHERE a[1] < 5 and
arrtest.c = '{"foobar"}'::_name; c = '{"foobar"}'::_name;
-- updating array subranges seems to be broken UPDATE arrtest
-- SET a[1:2] = '{16,25}',
-- UPDATE arrtest b[1:1][1:1][1:2] = '{113, 117}',
-- SET a[1:2] = '{16,25}', c[1:1] = '{"new_word"}';
-- b[1:1][1:1][1:2] = '{113, 117}',
-- c[1:1] = '{"new_word"}'; SELECT a[1:3],
b[1:1][1:2][1:2],
SELECT arrtest.a[1:3], c[1:2],
arrtest.b[1:1][1:2][1:2], d[1:1][2:2]
arrtest.c[1:2],
arrtest.d[1:1][1:2]
FROM arrtest; FROM arrtest;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment