title: Conditionally delete item inside an Array Field PostgreSQL
body: <p>I'm building a kind of dictionary app and I have a table for storing words like below:</p>
  
  <pre><code>id | surface_form | examples
  -----------------------------------------------------------------------
   1 | sounds       | {"It sounds as though you really do believe that",
     |              |  "A different bell begins to sound midnight"}
  </code></pre>
  
  <p>Where <code>surface_form</code> is of type <code>CHARACTER VARYING</code> and <code>examples</code> is an array field of <code>CHARACTER VARYING</code></p>
  
  <p>Since the examples are generated automatically from another API, it might not contain the exact "surface_form". Now I want to keep in examples only sentences that contain the exact surface_form. For instance, in the given example, only the first sentence is kept as it contain <code>sounds</code>, the second should be omitted as it only contain <code>sound</code>.</p>
  
  <p>The problem is I got stuck in how to write a query and/or plSQL stored procedure to update the <code>examples</code> column so that it only has the desired sentences.</p>