Postgres change datatype during select into statement
<p>Running postgres with postgis extension: trying to change datatype of column during a select into table statement </p>

<p>The column sum_popint in the munsummary table is double and I want to change it into an integer column during the select statement. I am aware I can alter the column datatype to integer before or after the select into statement using the update/alter statements but i want to do it within the select statement. </p>

<pre><code>SELECT county,
       SUM(sum_popint) AS residentialpopulation,
       st_union(geom)
INTO countysummary
FROM munsummary
GROUP BY county;
</code></pre>