How to resolve - ERROR: cannot cast type numeric to boolean
There is no direct cast defined between numeric and boolean. You can use integer as middle-ground.
ALTER TABLE <schema>.<table_name> ALTER <column_name> TYPE bool USING (<column_name>::int::bool);
Ex:
ALTER TABLE SANGA.SANGA_H_TRANSACTION_DETAILS ALTER is_active TYPE bool USING (is_active::int::bool);
Comments