title: Postgres Alter Column Integer to Boolean
body: <p>I've a field that is INTEGER NOT NULL DEFAULT 0 and I need to change that to bool.</p>
  
  <p>This is what I am using:</p>
  
  <pre><code>ALTER TABLE mytabe 
  ALTER mycolumn TYPE bool 
  USING 
      CASE 
          WHEN 0 THEN FALSE 
          ELSE TRUE 
      END;
  </code></pre>
  
  <p>But I am getting:</p>
  
  <pre><code>ERROR:  argument of CASE/WHEN must be type boolean, not type integer
  
  ********** Error **********
  
  ERROR: argument of CASE/WHEN must be type boolean, not type integer
  SQL state: 42804
  </code></pre>
  
  <p>Any idea?</p>
  
  <p>Thanks.</p>