-- json和jsonb操作符
-- select '[{"a":"foo"},{"b":"bar"},{"c":"baz"}]'::json->2;
-- select '{"a": {"b":"foo"}}'::json->'a'; -- 支持 ->
-- SELECT '[1,2,3]'::json->>2;
-- SELECT '{"a":1,"b":2}'::json->>'b'; -- 支持 ->>
-- SELECT '{"a": {"b":{"c": "foo"}}}'::json #> '{a,b}'; -- 支持 #>
-- SELECT '{"a":[1,2,3],"b":[4,5,6]}'::json #>> '{a,2}'; -- 支持 #>>
-- SELECT '{"a":1, "b":2}'::jsonb @> '{"b":2}'::jsonb; -- 支持 @>
-- SELECT '{"b":2}'::jsonb <@ '{"a":1, "b":2}'::jsonb; -- 支持 <@
-- SELECT '{"a":1, "b":2}'::jsonb ? 'b'; -- 支持 ?
-- SELECT '{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c'];-- 支持 ?|
-- SELECT '["a", "b"]'::jsonb || '["c", "d"]'::jsonb; -- 不支持 ||
-- SELECT '{"a": "b"}'::jsonb - 'a'; -- 不支持 -
-- SELECT '["a", {"b":1}]'::jsonb #- '{1,b}'; -- 不支持 #-
-- json和jsonb操作函数
-- SELECT to_json('Fred said "Hi."'::text); -- 支持 to_json
-- SELECT array_to_json('{{1,5},{99,100}}'::int[]); -- 支持 array_to_json
-- SELECT row_to_json(row(1,'foo')); -- 支持 row_to_json
-- SELECT json_build_array(1,2,'3',4,5); -- 支持 json_build_array
-- SELECT json_build_object('foo',1,'bar',2) -- 支持 json_build_object
-- SELECT json_agg(1); -- 支持 json_agg
-- SELECT json_object_agg(2,1); -- 支持 json_object_agg
-- SELECT json_object('{a, 1, b, "def", c, 3.5}');
-- SELECT json_object('{{a, 1},{b, "def"},{c, 3.5}}'); -- 支持 json_object
-- SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); -- 支持 json_array_length
-- select * from json_each('{"a":"foo", "b":"bar"}'); -- 支持 json_each
-- select * from json_each_text('{"a":"foo", "b":"bar"}'); -- 支持 json_each_text
-- SELECT json_extract_path('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4'); -- 支持 json_extract_path
-- SELECT json_extract_path_text('{"f2":{"f3":1},"f4":{"f5":99,"f6":"foo"}}','f4', 'f6'); -- 支持 json_extract_path_text
-- SELECT json_object_keys('{"f1":"abc","f2":{"f3":"a", "f4":"b"}}'); -- 支持 json_object_keys
-- create type jpop as (a text, b int, c bool);
-- select * from json_populate_record(null::jpop, '{"a":1,"b":2}'); -- 支持 json_populate_record
-- create type jpop as (a text, b int, c bool);
-- select * from json_populate_recordset(null::jpop, '[{"a":1,"b":2},{"a":3,"b":4}]'); -- 支持 json_populate_recordset
-- select * from json_array_elements('[1,true, [2,false]]'); -- 支持 json_array_elements
-- select * from json_array_elements_text('["foo", "bar"]'); -- 支持 json_array_elements_text
-- SELECT json_typeof('-123.4'); -- 支持 json_typeof
-- select * from json_to_record('{"a":1,"b":"foo","c":"bar"}',true) as x(a int, b text, d text); -- 支持 json_to_record
-- select * from json_to_recordset('[{"a":1,"b":"foo"},{"a":2,"c":"bar"}]') as x(a int, b text); -- 不支持 json_to_recordset
-- SELECT json_strip_nulls('[{"f1":1,"f2":null},2,null,3]'); -- 不支持 json_strip_nulls
-- select * from json_array_elements_text('[1,true,[1,[2,3]],null]'); -- 支持 json_array_elements_text
-- select json_extract_path_text_op('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}', 'f4','f6'); -- 不支持 json_extract_path_text_op
--
-- SELECT jsonb_exists('{"a":1,"b":2}'::jsonb, 'a'); -- 支持 jsonb_exists
-- select jsonb_set('{"name":"ss","age":100,"die":true}' ,'{name}','"t5t"'); -- 不支持 jsonb_set
-- SELECT jsonb_agg(1); -- 不支持 jsonb_agg
-- SELECT jsonb_object_agg(2,1); -- 不支持 jsonb_object_agg
-- SELECT jsonb_object('{a, b}', '{1,2}'); -- 支持 jsonb_object
-- SELECT jsonb_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]'); -- 支持 jsonb_array_length
-- SELECT jsonb_build_object('foo',1,'bar',2); -- 不支持 jsonb_build_object
-- select * from jsonb_each('{"a":"foo", "b":"bar"}'); -- 支持 jsonb_each
-- select * from jsonb_each_text('{"a":"foo", "b":"bar"}'); -- 支持 jsonb_each_text
-- SELECT jsonb_object_keys('{"f1":"abc","f2":{"f3":"a", "f4":"b"}}'); -- 支持 jsonb_object_keys
-- select * from json_populate_recordset(null::jpop, '[{"a":1,"b":2},{"a":3,"b":4}]'); -- 支持 jsonb_populate_recordset
-- select * from jsonb_populate_record(null::jpop, '{"a":1,"b":2}'); -- 支持 jsonb_populate_record
-- SELECT jsonb_set('[{"f1":1,"f2":null},2,null,3]', '{0,f1}','[2,3,4]', false); -- 不支持 jsonb_set
-- SELECT jsonb_pretty('[{"f1":1,"f2":null},2,null,3]'); -- 不支持 jsonb_pretty
-- select json_array_elements('[1,true,[1,[2,3]],null]'); -- 支持 json_array_elements
-- select jsonb_array_elements('[1,true,[1,[2,3]],null]'); -- 支持 jsonb_array_elements
-- select * from jsonb_to_record('{"a":1,"b":"foo","c":"bar"}',true) as x(a int, b text, d text); -- 不支持 jsonb_to_record
-- select * from jsonb_array_elements_text('[1,true,[1,[2,3]],null]'); -- 支持 jsonb_array_elements_text
-- select jsonb_extract_path_text_op('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}', 'f4','f6'); -- 不支持 jsonb_extract_path_text_op