Say I have the following enum:
CREATE TYPE "my_enum" AS ENUM('value1', 'value2', 'value3');
I would like get remove value3
. From what I can see in the documentation and in previous threads, I actually have to drop the whole enum and recreate it with the values I want. Something like this:
DROP TYPE IF EXISTS "my_enum";
CREATE TYPE "my_enum" AS ENUM('value1', 'value2');
The issue with that is I have other tables that depend on this enum, so it won't allow me to do so. I get the following message (rightfully so):
ERROR: cannot drop type "my_enum" because other objects depend on it
So my question is how can I remove one of the enums values without dropping the whole thing? I know I can easily add values by just altering:
ALTER TYPE "my_enum" ADD VALUE 'value4';
So I would think I could do something to the equivalent when removing.
Thanks!