test=*# create table michi_r (id text);
CREATE TABLE
test=*# insert into michi_r values ('0123A');
INSERT 0 1
test=*# select * from michi_r where (regexp_replace(id, '[^0-9]','','g'))::int > 150;
id
----
(0 rows)
test=*# select * from michi_r where (regexp_replace(id, '[^0-9]','','g'))::int < 150;
id
-------
0123A
(1 row)