当前位置:Gxlcms > 数据库问题 > postgresql jsonb 操作

postgresql jsonb 操作

时间:2021-07-01 10:21:17 帮助过:5人阅读

  

新增和更新 可以都通过 jsonb_set 实现

update 表名 set 列名 = (jsonb_set(列名::jsonb,‘{key}‘,‘"value"‘::jsonb,true)) where 条件 

1 要注意里面的单引号和双引号
2 true 代表没有会新增,false 代表没有改项,不会新增。

删除

update 表名
set 列名 = 列名::jsonb-‘key‘
where  条件


 

  

postgresql jsonb 操作

标签:条件   where   gre   HERE   注意   删除   post   更新   false   

人气教程排行