Answers for "postgress update jsonb column"

SQL
1

postgresql update json field key value

UPDATE table_name SET attrs = jsonb_set(cast(attrs as jsonb), '{key}', '"new_value"', true) WHERE id = 'some_id';
Posted by: Guest on July-29-2020
0

postgres jsonb array push new element

UPDATE jsontesting
SET jsondata = jsondata || '["newString"]'::jsonb
WHERE id = 7;
Posted by: Guest on August-11-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language