public inbox for [email protected]  
help / color / mirror / Atom feed
Can we only add values to enums?
5+ messages / 4 participants
[nested] [flat]

* Can we only add values to enums?
@ 2018-03-12 23:28 PG Doc comments form <[email protected]>
  2018-03-16 03:33 ` Re: Can we only add values to enums? Euler Taveira <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: PG Doc comments form @ 2018-03-12 23:28 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Can we only add values to enums?
  2018-03-12 23:28 Can we only add values to enums? PG Doc comments form <[email protected]>
@ 2018-03-16 03:33 ` Euler Taveira <[email protected]>
  2018-03-16 13:14   ` Re: Can we only add values to enums? Jonathan S. Katz <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Euler Taveira @ 2018-03-16 03:33 UTC (permalink / raw)
  To: [email protected]; [email protected]

2018-03-12 20:28 GMT-03:00 PG Doc comments form <[email protected]>:
> 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/[email protected]


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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Can we only add values to enums?
  2018-03-12 23:28 Can we only add values to enums? PG Doc comments form <[email protected]>
  2018-03-16 03:33 ` Re: Can we only add values to enums? Euler Taveira <[email protected]>
@ 2018-03-16 13:14   ` Jonathan S. Katz <[email protected]>
  2018-03-16 14:48     ` Re: Can we only add values to enums? Tom Lane <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Jonathan S. Katz @ 2018-03-16 13:14 UTC (permalink / raw)
  To: Euler Taveira <[email protected]>; +Cc: [email protected]; [email protected]


> On Mar 15, 2018, at 11:33 PM, Euler Taveira <[email protected]> wrote:
> 
> 2018-03-12 20:28 GMT-03:00 PG Doc comments form <[email protected]>:
>> 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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Can we only add values to enums?
  2018-03-12 23:28 Can we only add values to enums? PG Doc comments form <[email protected]>
  2018-03-16 03:33 ` Re: Can we only add values to enums? Euler Taveira <[email protected]>
  2018-03-16 13:14   ` Re: Can we only add values to enums? Jonathan S. Katz <[email protected]>
@ 2018-03-16 14:48     ` Tom Lane <[email protected]>
  2018-03-16 23:44       ` Re: Can we only add values to enums? Jonathan S. Katz <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-03-16 14:48 UTC (permalink / raw)
  To: Jonathan S. Katz <[email protected]>; +Cc: Euler Taveira <[email protected]>; [email protected]; [email protected]

"Jonathan S. Katz" <[email protected]> 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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Can we only add values to enums?
  2018-03-12 23:28 Can we only add values to enums? PG Doc comments form <[email protected]>
  2018-03-16 03:33 ` Re: Can we only add values to enums? Euler Taveira <[email protected]>
  2018-03-16 13:14   ` Re: Can we only add values to enums? Jonathan S. Katz <[email protected]>
  2018-03-16 14:48     ` Re: Can we only add values to enums? Tom Lane <[email protected]>
@ 2018-03-16 23:44       ` Jonathan S. Katz <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Jonathan S. Katz @ 2018-03-16 23:44 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Euler Taveira <[email protected]>; [email protected]; [email protected]


> On Mar 16, 2018, at 10:48 AM, Tom Lane <[email protected]> wrote:
> 
> "Jonathan S. Katz" <[email protected]> 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=013c0baaddd9df7e1f940184a8ab8e478214b... <https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=013c0baaddd9df7e1f940184a8ab8e478214b...;

Thanks for the quick work!

Jonathan



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-03-16 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 23:28 Can we only add values to enums? PG Doc comments form <[email protected]>
2018-03-16 03:33 ` Euler Taveira <[email protected]>
2018-03-16 13:14   ` Jonathan S. Katz <[email protected]>
2018-03-16 14:48     ` Tom Lane <[email protected]>
2018-03-16 23:44       ` Jonathan S. Katz <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox