How do I delete an enum type value that I created in postgresql?
create type admin_level1 as enum('classifier', 'moderator', 'god');
E.g. I want to remove moderator
from the list.
I can't seem to find anything on the docs.
I'm using Postgresql 9.3.4.
Best Answer
You delete (drop) enum types like any other type, with
DROP TYPE
:Is it possible you're actually asking about how to remove an individual value from an enum type? If so, you can't. It's not supported:
You must create a new type without the value, convert all existing uses of the old type to use the new type, then drop the old type.
E.g.