I have a postgres table I loaded from a mongodb collection in postgres. Although the postgres column is of type 'bigint', there are rows that are larger than the max big int, so when I try to update another table from this table, it errors out. There are also bigint columns with illegal characters, such as "_2131441" which I cleared via
WHERE col_name !~ '^([0-9]+[.]?[0-9]*|[.][0-9]+)$';
How can I force cast an entire column to be valid according to it's type, and set it to null/none if otherwise?