How do I delete an enum type value that I created in postgresql?
create type admin_level1 as enum(\'classifier\', \'moderator\', \'god\');
Very well written here:
http://blog.yo1.dog/updating-enum-values-in-postgresql-the-safe-and-easy-way/
rename the existing type
ALTER TYPE status_enum RENAME TO status_enum_old;
create the new type
CREATE TYPE status_enum AS ENUM('queued', 'running', 'done');
update the columns to use the new type
ALTER TABLE job ALTER COLUMN job_status TYPE status_enum USING job_status::text::status_enum;
remove the old type
DROP TYPE status_enum_old;
Possible Errors and Troubleshooting:
invalid input value for enum {enum name}: "{some value}" - One or more rows have a value ("{some value}") that is not in your new type. You must handle these rows before you can update the column type.default for column "{column_name}" cannot be cast automatically to type {enum_name} - The default value for the column is not in your new type. You must change or remove the default value for the column before you can update the column type. Thanks to Philipp for this addition.