|
|
|
@ -2031,3 +2031,43 @@ SELECT width_bucket(5, ARRAY[3, 4, NULL]); |
|
|
|
|
ERROR: thresholds array must not contain NULLs |
|
|
|
|
SELECT width_bucket(5, ARRAY[ARRAY[1, 2], ARRAY[3, 4]]); |
|
|
|
|
ERROR: thresholds must be one-dimensional array |
|
|
|
|
-- slices with empty lower and/or upper index |
|
|
|
|
CREATE TABLE arrtest_s ( |
|
|
|
|
a int2[], |
|
|
|
|
b int2[][] |
|
|
|
|
); |
|
|
|
|
INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}'); |
|
|
|
|
SELECT a[:3], b[:2][:2] FROM arrtest_s; |
|
|
|
|
a | b |
|
|
|
|
---------+--------------- |
|
|
|
|
{1,2,3} | {{1,2},{4,5}} |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
SELECT a[2:], b[2:][2:] FROM arrtest_s; |
|
|
|
|
a | b |
|
|
|
|
-----------+--------------- |
|
|
|
|
{2,3,4,5} | {{5,6},{8,9}} |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
SELECT a[:], b[:] FROM arrtest_s; |
|
|
|
|
a | b |
|
|
|
|
-------------+--------------------------- |
|
|
|
|
{1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}} |
|
|
|
|
(1 row) |
|
|
|
|
|
|
|
|
|
-- errors |
|
|
|
|
UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14, 15}}'; |
|
|
|
|
ERROR: array subscript must have both boundaries |
|
|
|
|
LINE 1: UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{... |
|
|
|
|
^ |
|
|
|
|
HINT: You can't omit the upper or lower boundaries when updating or inserting |
|
|
|
|
UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28, 29}}'; |
|
|
|
|
ERROR: array subscript must have both boundaries |
|
|
|
|
LINE 1: UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{... |
|
|
|
|
^ |
|
|
|
|
HINT: You can't omit the upper or lower boundaries when updating or inserting |
|
|
|
|
UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; |
|
|
|
|
ERROR: array subscript must have both boundaries |
|
|
|
|
LINE 1: UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; |
|
|
|
|
^ |
|
|
|
|
HINT: You can't omit the upper or lower boundaries when updating or inserting |
|
|
|
|