title: How to prevent 'invalid input syntax for type json' in Postgres, when records contain a mix of json or strings
body: <p>I have a text column that contains JSON and also plan text.  I want to convert it to JSON, and then select a particular property.  For example:</p>
  
  <pre><code>user_data
  _________
  {"user": {"name": "jim"}}
  {"user": {"name": "sally"}}
  some random data string
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>select user_data::json#&gt;'{user,name}' from users
  </code></pre>
  
  <p>I get: </p>
  
  <pre><code>ERROR:  invalid input syntax for type json
  DETAIL:  Token "some" is invalid.
  CONTEXT:  JSON user_data, line 1: some...
  </code></pre>
  
  <p>Is it possible to prevent this?</p>