a27bcbcd创建于 2023年3月16日历史提交
create schema test_json_array_append;
set current_schema to 'test_json_array_append';

select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[0]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1][0]', 4);
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', '$.hobby', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', '$.name', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', '$.hobby[0]', 'food');
select JSON_ARRAY_APPEND('[1, 2]', '$[1]', 3);
select JSON_ARRAY_APPEND('[1, 2]', '$[0]', 3);
select JSON_ARRAY_APPEND('[1, 2]', '$[1]', 4);
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": "car"}', '$.hobby', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": "car"}', '$.name', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": "car"}', '$.hobby', 'drink');
select JSON_ARRAY_APPEND(null, '$[1]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', null, 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[3]', 4);
select JSON_ARRAY_APPEND(null, '$.hobby', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', null, 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', '$.car', 'food');
select JSON_ARRAY_APPEND('{"name": "Tim", "hobby": ["car"]}', '$', 'food');
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', 4, '$[1]', 5);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', null);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', true);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', '');
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', json '{"x": 3, "y": [1,2,3]}');
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1]', 1.2);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '[1]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[1', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$.1', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$..1', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[*]', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[*]', 日);
select JSON_ARRAY_APPEND('[1, [2, 3]]', ' ', 4);
select JSON_ARRAY_APPEND('[1, [2, 3]]'::varchar(20), '$[1]', null);
select JSON_ARRAY_APPEND('[1, [2, 3]]'::bpchar, '$[1]', null);
select JSON_ARRAY_APPEND('[1, [2, 3]]', '$[0]', null);
select json_array_append('[1]', '$[0]', 341522654875451.12345678901234567890123456789012345678901234567890);

drop schema test_json_array_append cascade;
reset current_schema;