how to parse json using json_populate_recordset in postgres

后端 未结 2 1423
臣服心动
臣服心动 2021-01-17 07:59

I have a json stored as text in one of my database row. the json data is as following

[{\"id\":67272,\"name\":\"EE_Quick_Changes_J_UTP.xlsx\"},{\"id\":67273,         


        
2条回答
  •  轮回少年
    2021-01-17 09:04

    no need to create a new type for that.

    select * from json_populate_recordset(null::record,'[{"id_item":1,"id_menu":"34"},{"id_item":2,"id_menu":"35"}]')
     AS
     (
        id_item int
        , id_menu int
     )
    

提交回复
热议问题