Thread
Commits
-
Doc: explicitly point out that enum values can't be dropped.
- 013c0baaddd9 11.0 landed
- f4512fa5b3af 9.5.13 landed
- b7fbd3f48386 10.4 landed
- a9d0c862d53d 9.3.23 landed
- 21c90dfcf830 9.4.18 landed
- 02c4ad357d21 9.6.9 landed
-
Can we only add values to enums?
The Post Office <noreply@postgresql.org> — 2018-03-12T23:28:53Z
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.
-
Re: Can we only add values to enums?
Euler Taveira <euler@timbira.com.br> — 2018-03-16T03:33:54Z
2018-03-12 20:28 GMT-03:00 PG Doc comments form <noreply@postgresql.org>: > 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. > 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/4C1B95E2.6090508@dunslane.net -- Euler Taveira Timbira - http://www.timbira.com.br/ PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
-
Re: Can we only add values to enums?
Jonathan S. Katz <jkatz@postgresql.org> — 2018-03-16T13:14:31Z
> On Mar 15, 2018, at 11:33 PM, Euler Taveira <euler@timbira.com.br> wrote: > > 2018-03-12 20:28 GMT-03:00 PG Doc comments form <noreply@postgresql.org>: >> 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. >> > 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. 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
-
Re: Can we only add values to enums?
Tom Lane <tgl@sss.pgh.pa.us> — 2018-03-16T14:48:01Z
"Jonathan S. Katz" <jkatz@postgresql.org> writes: > I would say that’s the exact reason why it should be documented, > so it’s clear that it was by design. Seems reasonable. Maybe something in 8.7.4 enum implementation details? regards, tom lane
-
Re: Can we only add values to enums?
Jonathan S. Katz <jkatz@postgresql.org> — 2018-03-16T23:44:11Z
> On Mar 16, 2018, at 10:48 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > "Jonathan S. Katz" <jkatz@postgresql.org> writes: >> I would say that’s the exact reason why it should be documented, >> so it’s clear that it was by design. > > Seems reasonable. Maybe something in 8.7.4 enum implementation details? 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