Upgrading a varchar column to enum type in postgresql
You need to define a cast to be used because there is no default cast available. If all values in the varcharColumn comply with the enum definition, the following should work: alter table foo ALTER COLUMN varcharColumn TYPE enum_type using varcharColumn::enum_type; I personally don’t like enums because they are quite unflexible. I prefer a check … Read more