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 transaction block
The query I used to add a new value to the type is
ALTER TYPE public.request_type ADD VALUE "Check";
I am actually running above query in migrations file which is created using node-pg-migrate
Here public is my schema.
Any idea why this is failing?
Edit:
The below query executes fine when execute it in pgadmin
ALTER TYPE public.request_type ADD VALUE "Check";
But when I run above command through node-pg-migrate migrations it fails and throws above error