I have a nullable boolean column my_column.
I have enum type called my_enum with 3 values (ENABLED/DISABLED/INHERITED).
I want to change this column data as follows:
TRUEbecomesENABLEDFALSEbecomesDISABLEDNULLbecomesINHERITED
Is there a way to provide the mapping in a single alter table statement?
Schematically I'd want something like this:
ALTER TABLE my_table
ALTER COLUMN my_column TYPE my_type USING (
{
TRUE => ENABLED,
FALSE => DISABLED,
NULL => INHERITED
}
);