jsonb_each()将json对象转变键和值

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# select  f_jsonb  from t_jsonb where id=1;
                   f_jsonb                   
---------------------------------------------
 {"col": "pgxz", "col1": 1, "col2": "TDSQL PG"}
(1 row)
postgres=#  select * from  jsonb_each((select  f_jsonb  from t_jsonb where id=1)); 
 key  |  value  
------+---------
 col  | "pgxz"
 col1 | 1
 col2 | "TDSQL PG"
(3 rows)