title: Extracting data from a text field holding JSON information
body: <p>I am new to JSON and PostgreSQL.
  I have data like shown below. The movieGenres is a <code>TEXT</code> field.</p>
  <p><strong>movieGenres</strong></p>
  <pre><code>[{'id': 1, 'name': 'Comedy'}]
  [{'id': 2, 'name': 'Action'}, {'id': 3, 'name': 'Crime'}, {'id': 4, 'name': 'Drama'}, {'id': 5, 'name': 'Thriller'}]
  [{'id': 1, 'name': 'Comedy'}, {'id': 6, 'name': 'Romance'}]
  [{'id': 2, 'name': 'Action'}, {'id': 7, 'name': 'Adventure'}, {'id': 4, 'name': 'Drama'}, {'id': 8, 'name': 'Family'}]
  </code></pre>
  <p>I want to get the distinct list of genres from this list like</p>
  <pre><code>{'id': 1, 'name': 'Comedy'}
  {'id': 6, 'name': 'Romance'}
  {'id': 7, 'name': 'Adventure'}
  </code></pre>
  <p>There are multiple genres mapped to an ID in a single field  and I am trying to extract the unique Id and genre names from the &quot;Genres&quot; field in the above data. How do I do it in postgresql?</p>