Skip to content

Instantly share code, notes, and snippets.

@faulker
Created October 27, 2016 18:40
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save faulker/6fa6cc7fec7dc851c92d6b0d984e7b6e to your computer and use it in GitHub Desktop.
Save faulker/6fa6cc7fec7dc851c92d6b0d984e7b6e to your computer and use it in GitHub Desktop.
Example of how to update a Postgresql JSON field using jsonb_set
update tests_summary_data set data = (jsonb_set(to_jsonb(data), '{misc,gap,pa}', '-1', false))::json where data->'misc'->'gap'->>'pa' = '0';
@rajesh9697
Copy link

hi can you show the result of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment