psql -h 127.0.0.1 -p 5432 -U <USERNAME> -d <DBNAME>
public=# UPDATE order SET price = 1000.7 WHERE id = 1830;
UPDATE 1
public=# SELECT price FROM order WHERE id = 1830;
price
-------
1001
(1 row)
public=# UPDATE order SET price = '1000.7' WHERE id = 1830;
ERROR: invalid input syntax for type integer: "1000.7"
public=# alter table order
public-# alter column price type decimal using price::decimal;
ALTER TABLE
public=# UPDATE order SET price = 1000.6 WHERE id = 1830;
UPDATE 1
public=# SELECT price FROM order WHERE id = 1830;
price
--------
1000.6
(1 row)
public=# UPDATE order SET price = '1000.5' WHERE id = 1830;
UPDATE 1
public=# SELECT price FROM order WHERE id = 1830;
price
--------
1000.5
(1 row)
public=# SELECT price FROM store_order WHERE id = 1830;
price
--------
1000.5
(1 row)
public=# alter table store_order
public-# alter column price type integer using price::integer;
ALTER TABLE
public=# SELECT price FROM store_order WHERE id = 1830;
price
-------
1001
(1 row)