Subject: Can we only add values to enums?

From: PG Doc comments form <[email-masked]>
Date: Mon, 12 Mar 2018 23:28:53 +0000

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/sql-altertype.html
Description:

I need to add a value to an enum, so I found this page, which answered my
question. However, I found it quite confusing that it only documents adding
a value. I would expect it to also document how to remove a value from an
enum? Is this not possible? If not, I consider it a bug. But either way, if
it is not possible, you should explicitly document it on this page.

---

From: Euler Taveira <[email-masked]>
Date: Fri, 16 Mar 2018 00:33:54 -0300

> it is not possible, you should explicitly document it on this page.
If it is not document, this means that it is not supported. It is not
a bug. It is by design. Read the discussion about this feature at [1].
Removing a enum value requires a table rewrite. I'm not sure it is
worth a note.

[1] https://www.postgresql.org/message-id/[email-masked]

-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Fri, 16 Mar 2018 09:14:31 -0400

> On Mar 15, 2018, at 11:33 PM, Euler Taveira <[email-masked]> wrote:
> 

I would say that’s the exact reason why it should be documented,
so it’s clear that it was by design.

We could also redirect people to DOMAINs if they need more
flexibility in what is added/removed from an “enum-like” type.

Jonathan

---

From: Tom Lane <[email-masked]>
Date: Fri, 16 Mar 2018 10:48:01 -0400

> so it’s clear that it was by design.

Seems reasonable.  Maybe something in 8.7.4 enum implementation details?

			regards, tom lane

---

From: "Jonathan S. Katz" <[email-masked]>
Date: Fri, 16 Mar 2018 19:44:11 -0400

> On Mar 16, 2018, at 10:48 AM, Tom Lane <[email-masked]> wrote:
> 

I was going to take a crack at writing it, and noticed it had already
been committed:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=013c0baaddd9df7e1f940184a8ab8e478214b46c <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=013c0baaddd9df7e1f940184a8ab8e478214b46c>

Thanks for the quick work!

Jonathan