Skip to content

Instantly share code, notes, and snippets.

@AlxGolubev
Created June 26, 2017 16:41
Show Gist options
  • Select an option

  • Save AlxGolubev/61498b2f74a5b9b572803e2dd5bd55a6 to your computer and use it in GitHub Desktop.

Select an option

Save AlxGolubev/61498b2f74a5b9b572803e2dd5bd55a6 to your computer and use it in GitHub Desktop.

Revisions

  1. AlxGolubev revised this gist Jun 26, 2017. No changes.
  2. AlxGolubev created this gist Jun 26, 2017.
    1 change: 1 addition & 0 deletions update-json-in-postgres.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    UPDATE users SET preferences = jsonb_set(to_jsonb(preferences), '{some_preference}'::text[], 'true'::jsonb, true);