-- bigistore istore_io should persist istores; CREATE TABLE istore_io1 AS SELECT '-2147483647 => 10, -10 => -9223372036854775807, 0 => 5, 10 => 9223372036854775806, 2147483647 => 10'::bigistore; SELECT * FROM istore_io1; bigistore --------------------------------------------------------------------------------------------------------------- "-2147483647"=>"10", "-10"=>"-9223372036854775807", "0"=>"5", "10"=>"9223372036854775806", "2147483647"=>"10" (1 row) -- bigistore istore_io should persist istores; CREATE TABLE istore_io2 AS SELECT '"-1"=>"+1","1"=>"2"'::bigistore; SELECT * FROM istore_io2; bigistore --------------------- "-1"=>"1", "1"=>"2" (1 row) -- bigistore istore_io should persist istores; CREATE TABLE istore_io3 AS SELECT ' "-1"=>"+1","1"=>"2"'::bigistore; SELECT * FROM istore_io3; bigistore --------------------- "-1"=>"1", "1"=>"2" (1 row) -- bigistore istore_io should persist empty istores; CREATE TABLE istore_io4 AS SELECT ''::bigistore; SELECT * FROM istore_io4; bigistore ----------- (1 row) -- bigistore istore_io should turn istore to json; SELECT istore_to_json('-2147483647 => 10, -10 => -9223372036854775807, 0 => 5, 10 => 9223372036854775806, 2147483647 => 10'::bigistore); istore_to_json ------------------------------------------------------------------------------------------------------- {"-2147483647": 10, "-10": -9223372036854775807, "0": 5, "10": 9223372036854775806, "2147483647": 10} (1 row) -- bigistore istore_io invalid input should report invalid value input; SELECT '2=>4, 1=>foo, 5=>17'::bigistore; ERROR: invalid input syntax for istore: "2=>4, 1=>foo, 5=>17" LINE 1: SELECT '2=>4, 1=>foo, 5=>17'::bigistore; ^ DETAIL: unexpected sign 'f', expected number -- bigistore istore_io invalid input should report invalid value input; SELECT '2=>4, 1=>5foo, 5=>17'::bigistore; ERROR: invalid input syntax for istore: "2=>4, 1=>5foo, 5=>17" LINE 1: SELECT '2=>4, 1=>5foo, 5=>17'::bigistore; ^ DETAIL: unexpected sign 'f', in istore value -- bigistore istore_io invalid input should report to big value input; SELECT '2=>4, 1=>18446744073709551612, 5=>17'::bigistore; ERROR: istore "2=>4, 1=>18446744073709551612, 5=>17" is out of range LINE 1: SELECT '2=>4, 1=>18446744073709551612, 5=>17'::bigistore; ^ -- bigistore istore_io invalid input should report to small value input; SELECT '2=>4, 1=>-18446744073709551614, 5=>17'::bigistore; ERROR: istore "2=>4, 1=>-18446744073709551614, 5=>17" is out of range LINE 1: SELECT '2=>4, 1=>-18446744073709551614, 5=>17'::bigistore; ^ -- bigistore istore_io invalid input should report invalid key input; SELECT '2=>4, 54foo=>5, 5=>17'::bigistore; ERROR: invalid input syntax for istore: "2=>4, 54foo=>5, 5=>17" LINE 1: SELECT '2=>4, 54foo=>5, 5=>17'::bigistore; ^ DETAIL: unexpected sign 'f', in istore key -- bigistore istore_io invalid input should report invalid key input; SELECT '2=>4, foo=>5, 5=>17'::bigistore; ERROR: invalid input syntax for istore: "2=>4, foo=>5, 5=>17" LINE 1: SELECT '2=>4, foo=>5, 5=>17'::bigistore; ^ DETAIL: unexpected sign 'f', expected number -- bigistore istore_io invalid input should report to big key input; SELECT '2=>4, 4000000000=>5, 5=>17'::bigistore; ERROR: istore "2=>4, 4000000000=>5, 5=>17" is out of range LINE 1: SELECT '2=>4, 4000000000=>5, 5=>17'::bigistore; ^ -- bigistore istore_io invalid input should report to small key input; SELECT '2=>4, -4000000000=>5, 5=>17'::bigistore; ERROR: istore "2=>4, -4000000000=>5, 5=>17" is out of range LINE 1: SELECT '2=>4, -4000000000=>5, 5=>17'::bigistore; ^ -- bigistore istore_io invalid input should report invalid delimiter input; SELECT '2=>4, 10=5, 5=>17'::bigistore; ERROR: invalid input syntax for istore: "2=>4, 10=5, 5=>17" LINE 1: SELECT '2=>4, 10=5, 5=>17'::bigistore; ^ DETAIL: unexpected sign '5', expected '>' -- bigistore istore_io invalid input should report unexpected end of line; SELECT '1=>2,2='::bigistore; ERROR: invalid input syntax for istore: "1=>2,2=" LINE 1: SELECT '1=>2,2='::bigistore; ^ DETAIL: unexpected end of line, expected '>' -- bigistore istore_io array input should parse normal arrays tuple; SELECT '([1,2], [11, 22])'::bigistore; bigistore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- bigistore istore_io array input should parse normal arrays tuple with spaces; SELECT '([1, 2] ,[ 11, 22])'::bigistore; bigistore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- bigistore istore_io array input should parse normal small arrays tuple; SELECT '([1],[11])'::bigistore; bigistore ----------- "1"=>"11" (1 row) -- bigistore istore_io array input should parse normal empty arrays tuple; SELECT '([],[])'::bigistore; bigistore ----------- (1 row) -- bigistore istore_io array invalid input should report unexpected end of line; SELECT '([1,2], ['::bigistore; ERROR: invalid input syntax for istore: "([1,2], [" LINE 1: SELECT '([1,2], ['::bigistore; ^ DETAIL: unexpected end of line, expected number -- bigistore istore_io array invalid input should report expected comma in values; SELECT '([1,2], [1'::bigistore; ERROR: invalid input syntax for istore: "([1,2], [1" LINE 1: SELECT '([1,2], [1'::bigistore; ^ DETAIL: unexpected end of line, expected ',' in values -- bigistore istore_io array invalid input should report expected number; SELECT '([1,2], [1,'::bigistore; ERROR: invalid input syntax for istore: "([1,2], [1," LINE 1: SELECT '([1,2], [1,'::bigistore; ^ DETAIL: unexpected end of line, expected number -- bigistore istore_io array invalid input should report on uneven tuples; SELECT '([1,2], [1,2,3])'::bigistore; ERROR: invalid input syntax for istore: "([1,2], [1,2,3])" LINE 1: SELECT '([1,2], [1,2,3])'::bigistore; ^ DETAIL: unexpected sign ',', expected square bracket -- bigistore istore_io array invalid input should report on uneven tuples; SELECT '([1,2,3],[1,2])'::bigistore; ERROR: invalid input syntax for istore: "([1,2,3],[1,2])" LINE 1: SELECT '([1,2,3],[1,2])'::bigistore; ^ DETAIL: unexpected sign ']', expected value -- bigistore istore_io array invalid input should report arrays delimiter; SELECT '([1,2]|[1,2])'::bigistore; ERROR: invalid input syntax for istore: "([1,2]|[1,2])" LINE 1: SELECT '([1,2]|[1,2])'::bigistore; ^ DETAIL: unexpected sign '|', expected valid arrays delimiter -- bigistore istore_io array invalid input should report on ending bracket; SELECT '([1,2],[1,2]'::bigistore; ERROR: invalid input syntax for istore: "([1,2],[1,2]" LINE 1: SELECT '([1,2],[1,2]'::bigistore; ^ DETAIL: unexpected end of line, expected ending bracket -- bigistore istore_io array invalid input should report integer out of range; SELECT '([2147483648], [1])'::bigistore; ERROR: istore "([2147483648], [1])" is out of range LINE 1: SELECT '([2147483648], [1])'::bigistore; ^ -- bigistore istore_io arrays row input should create bigistore from row; SELECT row_to_bigistore((array[1,2], array[11, 22])); row_to_bigistore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- bigistore istore_io arrays row input should create bigistore from row with int8 keys; SELECT row_to_bigistore((array[1::int8,2::int8], array[11, 22])); row_to_bigistore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- bigistore istore_io arrays row input should fail on other kind of rows (case 1); SELECT row_to_bigistore((array[1,2], array[11, 22], array[1,2])); ERROR: expected two arrays in wholerow -- bigistore istore_io arrays row input should fail on other kind of rows (case 2); SELECT row_to_bigistore((array[1,2], 'qwerty')); ERROR: expected only arrays in wholerow -- bigistore istore_io arrays row input should fail on other kind of rows (case 3); SELECT row_to_bigistore((array[1,2], array['1', '2'])); ERROR: unsupported array type -- bigistore istore_io arrays row input should fail on integer overflow (INT_MAX); SELECT row_to_bigistore((array[4147483647,2], array[11, 22])); ERROR: integer out of range -- bigistore istore_io arrays row input should fail on integer overflow (INT_MIN); SELECT row_to_bigistore((array[-4147483648,2], array[11, 22])); ERROR: integer out of range -- istore istore_io should persist istores; CREATE TABLE istore_io5 AS SELECT '-2147483647 => 10, -10 => -2147483647, 0 => 5, 10 => 2147483647, 2147483647 => 10'::istore; SELECT * FROM istore_io5; istore --------------------------------------------------------------------------------------------- "-2147483647"=>"10", "-10"=>"-2147483647", "0"=>"5", "10"=>"2147483647", "2147483647"=>"10" (1 row) -- istore istore_io should persist istores; CREATE TABLE istore_io6 AS SELECT '"-1"=>"+1","1"=>"2"'::istore; SELECT * FROM istore_io6; istore --------------------- "-1"=>"1", "1"=>"2" (1 row) -- istore istore_io should persist istores; CREATE TABLE istore_io7 AS SELECT ' "-1"=>"+1","1"=>"2"'::istore; SELECT * FROM istore_io7; istore --------------------- "-1"=>"1", "1"=>"2" (1 row) -- istore istore_io should persist empty istores; CREATE TABLE istore_io8 AS SELECT ''::istore; SELECT * FROM istore_io8; istore -------- (1 row) -- istore istore_io should turn istore to json; SELECT istore_to_json('-2147483647 => 10, -10 => -2147483647, 0 => 5, 10 => 2147483647, 2147483647 => 10'::istore); istore_to_json ------------------------------------------------------------------------------------- {"-2147483647": 10, "-10": -2147483647, "0": 5, "10": 2147483647, "2147483647": 10} (1 row) -- istore istore_io invalid input should report invalid value input; SELECT '2=>4, 1=>foo, 5=>17'::istore; ERROR: invalid input syntax for istore: "2=>4, 1=>foo, 5=>17" LINE 1: SELECT '2=>4, 1=>foo, 5=>17'::istore; ^ DETAIL: unexpected sign 'f', expected number -- istore istore_io invalid input should report invalid value input; SELECT '2=>4, 1=>5foo, 5=>17'::istore; ERROR: invalid input syntax for istore: "2=>4, 1=>5foo, 5=>17" LINE 1: SELECT '2=>4, 1=>5foo, 5=>17'::istore; ^ DETAIL: unexpected sign 'f', in istore value -- istore istore_io invalid input should report to big value input; SELECT '2=>4, 1=>4294967294, 5=>17'::istore; ERROR: integer out of range LINE 1: SELECT '2=>4, 1=>4294967294, 5=>17'::istore; ^ -- istore istore_io invalid input should report to small value input; SELECT '2=>4, 1=>-4294967294, 5=>17'::istore; ERROR: integer out of range LINE 1: SELECT '2=>4, 1=>-4294967294, 5=>17'::istore; ^ -- istore istore_io invalid input should report invalid key input; SELECT '2=>4, 54foo=>5, 5=>17'::istore; ERROR: invalid input syntax for istore: "2=>4, 54foo=>5, 5=>17" LINE 1: SELECT '2=>4, 54foo=>5, 5=>17'::istore; ^ DETAIL: unexpected sign 'f', in istore key -- istore istore_io invalid input should report invalid key input; SELECT '2=>4, foo=>5, 5=>17'::istore; ERROR: invalid input syntax for istore: "2=>4, foo=>5, 5=>17" LINE 1: SELECT '2=>4, foo=>5, 5=>17'::istore; ^ DETAIL: unexpected sign 'f', expected number -- istore istore_io invalid input should report to big key input; SELECT '2=>4, 4000000000=>5, 5=>17'::istore; ERROR: istore "2=>4, 4000000000=>5, 5=>17" is out of range LINE 1: SELECT '2=>4, 4000000000=>5, 5=>17'::istore; ^ -- istore istore_io invalid input should report to small key input; SELECT '2=>4, -4000000000=>5, 5=>17'::istore; ERROR: istore "2=>4, -4000000000=>5, 5=>17" is out of range LINE 1: SELECT '2=>4, -4000000000=>5, 5=>17'::istore; ^ -- istore istore_io invalid input should report invalid delimiter input; SELECT '2=>4, 10=5, 5=>17'::istore; ERROR: invalid input syntax for istore: "2=>4, 10=5, 5=>17" LINE 1: SELECT '2=>4, 10=5, 5=>17'::istore; ^ DETAIL: unexpected sign '5', expected '>' -- istore istore_io invalid input should report unexpected end of line; SELECT '1=>2,2='::istore; ERROR: invalid input syntax for istore: "1=>2,2=" LINE 1: SELECT '1=>2,2='::istore; ^ DETAIL: unexpected end of line, expected '>' -- istore istore_io array input should parse normal arrays tuple; SELECT '([1,2], [11, 22])'::istore; istore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- istore istore_io array input should parse normal arrays tuple with spaces; SELECT '([1, 2] ,[ 11, 22])'::istore; istore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- istore istore_io array input should parse normal small arrays tuple; SELECT '([1],[11])'::istore; istore ----------- "1"=>"11" (1 row) -- istore istore_io array input should parse normal empty arrays tuple; SELECT '([],[])'::istore; istore -------- (1 row) -- istore istore_io array invalid input should report unexpected end of line; SELECT '([1,2], ['::istore; ERROR: invalid input syntax for istore: "([1,2], [" LINE 1: SELECT '([1,2], ['::istore; ^ DETAIL: unexpected end of line, expected number -- istore istore_io array invalid input should report expected comma in values; SELECT '([1,2], [1'::istore; ERROR: invalid input syntax for istore: "([1,2], [1" LINE 1: SELECT '([1,2], [1'::istore; ^ DETAIL: unexpected end of line, expected ',' in values -- istore istore_io array invalid input should report expected number; SELECT '([1,2], [1,'::istore; ERROR: invalid input syntax for istore: "([1,2], [1," LINE 1: SELECT '([1,2], [1,'::istore; ^ DETAIL: unexpected end of line, expected number -- istore istore_io array invalid input should report on uneven tuples; SELECT '([1,2], [1,2,3])'::istore; ERROR: invalid input syntax for istore: "([1,2], [1,2,3])" LINE 1: SELECT '([1,2], [1,2,3])'::istore; ^ DETAIL: unexpected sign ',', expected square bracket -- istore istore_io array invalid input should report on uneven tuples; SELECT '([1,2,3],[1,2])'::istore; ERROR: invalid input syntax for istore: "([1,2,3],[1,2])" LINE 1: SELECT '([1,2,3],[1,2])'::istore; ^ DETAIL: unexpected sign ']', expected value -- istore istore_io array invalid input should report arrays delimiter; SELECT '([1,2]|[1,2])'::istore; ERROR: invalid input syntax for istore: "([1,2]|[1,2])" LINE 1: SELECT '([1,2]|[1,2])'::istore; ^ DETAIL: unexpected sign '|', expected valid arrays delimiter -- istore istore_io array invalid input should report on ending bracket; SELECT '([1,2],[1,2]'::istore; ERROR: invalid input syntax for istore: "([1,2],[1,2]" LINE 1: SELECT '([1,2],[1,2]'::istore; ^ DETAIL: unexpected end of line, expected ending bracket -- istore istore_io array invalid input should report integer out of range; SELECT '([2147483648], [1])'::istore; ERROR: istore "([2147483648], [1])" is out of range LINE 1: SELECT '([2147483648], [1])'::istore; ^ -- istore istore_io arrays row input should create istore from row; SELECT row_to_istore((array[1,2], array[11, 22])); row_to_istore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- istore istore_io arrays row input should create istore from row with int8 keys; SELECT row_to_istore((array[1::int8,2::int8], array[11, 22])); row_to_istore ---------------------- "1"=>"11", "2"=>"22" (1 row) -- istore istore_io arrays row input should fail on other kind of rows (case 1); SELECT row_to_istore((array[1,2], array[11, 22], array[1,2])); ERROR: expected two arrays in wholerow -- istore istore_io arrays row input should fail on other kind of rows (case 2); SELECT row_to_istore((array[1,2], 'qwerty')); ERROR: expected only arrays in wholerow -- istore istore_io arrays row input should fail on other kind of rows (case 3); SELECT row_to_istore((array[1,2], array['1', '2'])); ERROR: unsupported array type -- istore istore_io arrays row input should fail on integer overflow (INT_MAX); SELECT row_to_istore((array[4147483647,2], array[11, 22])); ERROR: integer out of range -- istore istore_io arrays row input should fail on integer overflow (INT_MIN); SELECT row_to_istore((array[-4147483648,2], array[11, 22])); ERROR: integer out of range -- istore should not fail on consecutive call of strtol select id, '1=>1'::bigistore from (values (2147483648)) v(id); id | bigistore ------------+----------- 2147483648 | "1"=>"1" (1 row) select id, '1=>1'::bigistore from (values (2147483648)) v(id); id | bigistore ------------+----------- 2147483648 | "1"=>"1" (1 row)