title: Postgres: handling null in where clause
body: <p>Using Birt reporting which allows injecting parameter in a query as follow:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT *
  FROM foo 
  WHERE bar = ?
  </code></pre>
  <p>The question mark comes from a drop down list. Among these values, 'All' can be selected, meaning there are no WHERE clause.</p>
  <p>Is there a way to have conditional value in the WHERE clause such as below or an equivalent ?</p>
  <pre class="lang-sql prettyprint-override"><code>WHERE
    CASE WHEN ? IS NULL 
    THEN 1=1
    ELSE bar = '%'
  END
  </code></pre>