Created
October 27, 2016 18:40
-
-
Save faulker/6fa6cc7fec7dc851c92d6b0d984e7b6e to your computer and use it in GitHub Desktop.
Example of how to update a Postgresql JSON field using jsonb_set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update tests_summary_data set data = (jsonb_set(to_jsonb(data), '{misc,gap,pa}', '-1', false))::json where data->'misc'->'gap'->>'pa' = '0'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi can you show the result of that