title: POSTGRESQL CASE-END CONDITION
body: <p>I want to use this case-end block in the postgresql query (the whole script is written in python). But, I run into the below error when I run the query and script with both or separately.</p>
  <pre><code>AND column_name &gt;= CASE
                         WHEN 'H' = 'E' THEN CONVERT(DATE_PART(now(), 'yyyy') || '0101' 
                         else '2017-01-01' 
                     END
  </code></pre>
  <blockquote>
  <p>error: SQL Error [42601]: ERROR: syntax error at or near &quot;else&quot;</p>
  </blockquote>
  <p>How can I fix the query? my mistake is in the case-end block usage? Did anyone experience this before?</p>