How to drop a value from an ENUM?

From: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How to drop a value from an ENUM?
Date: 2018-05-29 03:08:16
Message-ID: CAKkG4_=MMSFLd7RvUho4kStk-YDgHp96hAij_CQZV6xreWj-Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am absolutely sure a certain value of one of my ENUM types is not used in
the entire database. Now I am asked to drop that value. Unfortunately,
there is no ALTER TYPE DROP VALUE.

On my development box I tried

delete from pg_enum
where enumtypid='my_type_name'::regtype
and enumlabel='my_label'

It worked and I could not find any adverse effects.

Given the value is not used anywhere, is this a save command?

Thanks,
Torsten

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2018-05-29 05:54:52 binaries for 11 beta compiled with --with-llvm?
Previous Message Tim Cross 2018-05-28 22:06:20 Re: pgdg-keyring (or apt-key) failure on fresh 9.6 install