I have a table column that uses an enum type. I wish to update that enum type to have an additional possible value. I don’t want to delete any existing values, just add the new value. What is the simplest way to do this?
I have a table column that uses an enum type. I wish to update
Share
NOTE if you’re using PostgreSQL 9.1 or later, and you are ok with making changes outside of a transaction, see this answer for a simpler approach.
I had the same problem few days ago and found this post. So my answer can be helpful for someone who is looking for solution 🙂
If you have only one or two columns which use the enum type you want to change, you can try this. Also you can change the order of values in the new type.
3-6 should be repeated if there is more than 1 column.