title: Find what row holds a value which cannot be cast to integer
body: <p>I have some operations in heavy rearanging data tables which goes good so far.<br>
  In one table with more than 50000 rows I have text column where text should be numbers only.<br>
  Now I would like to convert it to integer column.<br>
  So:</p>
  
  <pre><code>ALTER TABLE mytable ALTER COLUMN mycolumn TYPE integer;
  </code></pre>
  
  <p>That produces an error 42804: *datatype_mismatch* </p>
  
  <p>By reading docs I find solution:</p>
  
  <pre><code>ALTER TABLE mytable ALTER COLUMN mycolumn TYPE integer USING (TRIM(mycolumn)::integer); 
  </code></pre>
  
  <p>But I am aware that data may not be correct in mean of number order since this "masks" an error and there is possibility that column was edited (by hand). After all, maybe is only trailing space added or some other minor editing was made.</p>
  
  <p>I have backup of data.<br>
  How would I find which exact cell of given column contain an error and which value cannot be casted to int with some handy query suitable for use from pgadmin?</p>
  
  <p>Please that query if is not complicated too much.</p>