I am trying to add new type value to my existing types in PostgreSQL. But I get the following error
error: ALTER TYPE ... ADD cannot run inside a transact
As it was mentioned above you can't edit enum within transaction block. But you can create the new one. Here are the steps:
ALTER TABLE table_name ALTER COLUMN request_type TYPE VARCHAR(255);
DROP TYPE IF EXISTS request_type;
CREATE TYPE request_type AS ENUM ('OLD_VALUE_1', 'OLD_VALUE_2', 'NEW_VALUE_1', 'NEW_VALUE_2');
ALTER TABLE table_name ALTER COLUMN request_type TYPE request_type USING (request_type::request_type);