PostgreSQL – Extract Digit Only from Column with Text Value
select substring(mycolumn from 'd+') from mytable
You may want to copy digit values from one column to another column which it’s data type is integer. Below is the sample of usage:
update dev_01 set lot_number = substring(lot from 'd+')::int;