title: Check if value is not null and not empty in a select query
body: <p>I have created a function in Postgresql and specified the returned type as <code>TABLE (id uuid, data boolean)</code>.</p>
  <p>This is the code that I have tried:</p>
  <pre><code>BEGIN
      RETURN QUERY SELECT table.id, (table.data &lt;&gt; '') as data FROM table;
  END
  </code></pre>
  <p>But it will return NULL for &quot;data&quot; when data is NULL in the table. I was expecting it to return FALSE.</p>
  <p>Data column is storing a JSON and I am trying to check if the stored value is not null and not empty</p>
  <p>How can I make this code work?</p>