@lexi.ch home, code, stuff

PostgreSQL: Change an ENUM type 08.12.2010

Changing an ENUM type in PostgreSQL is not an easy task. A small modification directly in the Schema does the trick:

INSERT INTO pg_enum(enumtypid,enumlabel)
VALUES(
(SELECT oid FROM pg_type WHERE typtype = 'e' AND typname = 'enum_typ_name'), 'neuer_wert'
);