答案 0 :(得分:2)
第一个返回json和第二个文本:
select
'[1,2,3]'::json->2 as "->",
pg_typeof('[1,2,3]'::json->2) as "-> type",
'[1,2,3]'::json->>2 as "-->",
pg_typeof('[1,2,3]'::json->>2) as "--> type"
;
-> | -> type | --> | --> type
----+---------+-----+----------
3 | json | 3 | text