title: How to convert from text to boolean with consideration of value in PostgreSQL
body: <p>I want to convert the datatype of a column in a table from <code>text</code> to <code>boolean</code>. The data in the column is <code>'t'</code> for true and <code>'f'</code> for false. </p>
  
  <p>I tried to convert it with this statement:</p>
  
  <p><code>ALTER TABLE public.checktypes ALTER COLUMN deleted SET DATA TYPE boolean USING deleted::boolean;</code></p>
  
  <p>This works for the conversion of the data type just fine. The problem is, all of them are now <code>false</code>. How can I accomplish that, if the value before the conversion is <code>'t'</code>, the boolean will set to <code>true?</code></p>