title: How to query for null values in json field type postgresql?
body: <p>I have a json type field in postgresql. However I can't select rows where specific field is null:</p>
  
  <p>Code:</p>
  
  <pre><code>SELECT *
  FROM   json_array_elements(
    '[{"name": "Toby", "occupation": "Software Engineer"},
      {"name": "Zaphod", "occupation": "Galactic President"} ,
  {"name2": "Zaphod", "occupation2": null} ]'  ) AS elem
  where elem#&gt;'{occupation2}' is null
  </code></pre>
  
  <p>This should work but I am getting this error:</p>
  
  <pre><code>ERROR:  operator does not exist: json #&gt; boolean
  LINE 6: where elem#&gt;'{occupation2}' is null
  </code></pre>