Guest User

postgres jsonb array append

a guest
Dec 17th, 2023
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PostgreSQL 0.24 KB | Source Code | 0 0
  1. UPDATE my_table
  2. SET json_data = jsonb_set(
  3.                     json_data,
  4.                     '{0}',
  5.                     json_data::jsonb || '{"name": "Bob", "age": 28}'::jsonb,
  6.                     true
  7.                 )
  8. WHERE id = 1;
Advertisement
Add Comment
Please, Sign In to add comment