title: PostgreSQL boolean cast (0 as false)
body: <p>I prefer 1/0 instead of t/f, so what should I use when converting boolean to integer?</p>
  
  <pre><code>select coalesce((null::boolean)::int, 0)
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>select case null::boolean when 't' then 1 else 0 end
  </code></pre>
  
  <p>... something else?</p>