avram icon indicating copy to clipboard operation
avram copied to clipboard

Make updating JSON columns easier with jsonb_set

Open jwoertink opened this issue 3 years ago • 1 comments

https://dev.to/deepika_banoth/how-to-use-jsonbset-function-in-postgresql-35eo

This function is pretty cool. I think we can utilize it to make updating JSON column data easier.

jwoertink avatar Mar 01 '22 17:03 jwoertink

jsonb_insert() is another cool one https://www.sqliz.com/postgresql-ref/jsonb_insert/

Here's some docs I found on the difference between these two https://docs.yugabyte.com/preview/api/ysql/datatypes/type_json/functions-operators/jsonb-set-jsonb-insert/

It looks like jsonb_set has a create_if_missing feature, and jsonb_insert has a insert_after feature...

jwoertink avatar Jun 02 '23 15:06 jwoertink