title: Change column datatype from Text to Integer in PostgreSQL
body: <p>I am using the following query to change the data type of a column from text to integer but getting error:</p>
  
  <pre><code> alter table a.attend alter column terminal TYPE INTEGER ;
  </code></pre>
  
  <blockquote>
    <p>ERROR:  column "terminal" cannot be cast automatically to type integer</p>
  </blockquote>