参考链接:https://www.cnblogs.com/panpanwelcome/p/14899488.html
1. 把数据类型的数据转化为多行
unnest(anyarray)
2. pgsql解析jsonb格式
fileds = [ {'fileds1': '', 'fileds2': '' }, {'fileds1': '', 'fileds2': '' }, ] select * from ( select * from table_test limit 10 ) as t, LATERAL jsonb_to_recordset(fileds) x(fileds1 text, fileds2 text)
3. pgsql多行转化为字符串
array_to_string(array_agg(t.name),',')把多行结果相加
4. 字符串转array
string_to_array(product_season, ','))
参考链接:https://www.postgresql.org/docs/9.4
https://www.postgresql.org/docs/9.4/functions-json.html