title: How to remove all JSON attributes with certain value in PostgreSQL
body: <p>given this table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>parent</th>
  <th>payload</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td><code>{ a: 7, b: 3 }</code></td>
  </tr>
  <tr>
  <td>2</td>
  <td><code>{ a: 7, c: 3 }</code></td>
  </tr>
  <tr>
  <td>1</td>
  <td><code>{ d: 3, e: 1, f: 3 }</code></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to update children of <code>1</code> and remove any attribute <code>X</code> where <code>payload-&gt;X</code> is <code>3</code>.</p>
  <p>after executing the query the records should look like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>parent</th>
  <th>payload</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td><code>{ a: 7 }</code></td>
  </tr>
  <tr>
  <td>2</td>
  <td><code>{ a: 7, c: 3 }</code></td>
  </tr>
  <tr>
  <td>1</td>
  <td><code>{ e: 1 }</code></td>
  </tr>
  </tbody>
  </table>
  </div>
  <pre><code>    update records set payload=?? where parent = 1 and ??
  </code></pre>