Created
July 12, 2018 12:25
-
-
Save chumakoff/24623e3d18a11d3b835abf4a1024efa3 to your computer and use it in GitHub Desktop.
postgres_update_json.sql
This file contains hidden or 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 table_name set data = (jsonb_set(to_jsonb(data), '{foo,bar,baz}', '1', false))::json where data->'foo'->'bar'->>'baz' = '0'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment