Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-03 Thread Tom Lane
Matthias van de Meent writes: > I don't quite get what the hard problem is that we haven't already > solved for other systems: > We already can add additional constraints to domains (e.g. VALUE::int > <> 4), which (according to docs) scan existing data columns for > violations. That's "solved" on

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-03 Thread Matthias van de Meent
On Tue, 3 Oct 2023 at 22:49, Tom Lane wrote: > > Andrew Dunstan writes: > > On 2023-09-28 Th 14:46, Tom Lane wrote: > >> We went through all these points years ago when the enum feature > >> was first developed, as I recall. Nobody thought that the ability > >> to remove an enum value was worth

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-03 Thread Tom Lane
Andrew Dunstan writes: > On 2023-09-28 Th 14:46, Tom Lane wrote: >> We went through all these points years ago when the enum feature >> was first developed, as I recall. Nobody thought that the ability >> to remove an enum value was worth the amount of complexity it'd >> entail. > That's quite t

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-03 Thread Vik Fearing
On 10/3/23 17:44, Tom Lane wrote: Vik Fearing writes: On 10/2/23 20:07, Dagfinn Ilmari Mannsåker wrote: FWIW I'm +1 on this patch, Thanks. and with Tom on dropping the "yet". To me it makes it sound like we intend to implement it soon (fsvo). I am not fundamentally opposed to it, nor

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-03 Thread Tom Lane
Vik Fearing writes: > On 10/2/23 20:07, Dagfinn Ilmari Mannsåker wrote: >> FWIW I'm +1 on this patch, > Thanks. >> and with Tom on dropping the "yet". To me it >> makes it sound like we intend to implement it soon (fsvo). > I am not fundamentally opposed to it, nor to any other wordsmithing th

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-02 Thread Vik Fearing
On 10/2/23 20:07, Dagfinn Ilmari Mannsåker wrote: Vik Fearing writes: No one except you has said anything about this patch. I think it would be good to commit it, wordsmithing aside. FWIW I'm +1 on this patch, Thanks. and with Tom on dropping the "yet". To me it makes it sound like we

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-02 Thread Dagfinn Ilmari Mannsåker
Vik Fearing writes: > On 9/29/23 03:17, Tom Lane wrote: >> Vik Fearing writes: >>> On 9/28/23 20:46, Tom Lane wrote: We went through all these points years ago when the enum feature was first developed, as I recall. Nobody thought that the ability to remove an enum value was wort

Re: Allow deleting enumerated values from an existing enumerated data type

2023-10-02 Thread Vik Fearing
On 9/29/23 03:17, Tom Lane wrote: Vik Fearing writes: On 9/28/23 20:46, Tom Lane wrote: We went through all these points years ago when the enum feature was first developed, as I recall. Nobody thought that the ability to remove an enum value was worth the amount of complexity it'd entail.

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-29 Thread Andrew Dunstan
On 2023-09-28 Th 14:46, Tom Lane wrote: Andrew Dunstan writes: I wonder if we could have a boolean flag in pg_enum, indicating that setting an enum to that value was forbidden. Yeah, but that still offers no coherent solution to the problem of what happens if there's a table that already con

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Tom Lane
Vik Fearing writes: > On 9/28/23 20:46, Tom Lane wrote: >> We went through all these points years ago when the enum feature >> was first developed, as I recall. Nobody thought that the ability >> to remove an enum value was worth the amount of complexity it'd >> entail. > This issue comes up reg

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Vik Fearing
On 9/28/23 20:46, Tom Lane wrote: Andrew Dunstan writes: I wonder if we could have a boolean flag in pg_enum, indicating that setting an enum to that value was forbidden. Yeah, but that still offers no coherent solution to the problem of what happens if there's a table that already contains s

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Tom Lane
Andrew Dunstan writes: > I wonder if we could have a boolean flag in pg_enum, indicating that > setting an enum to that value was forbidden. Yeah, but that still offers no coherent solution to the problem of what happens if there's a table that already contains such a value. It doesn't seem terr

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Andrew Dunstan
On 2023-09-28 Th 10:28, Tom Lane wrote: =?UTF-8?B?0JTQsNC90LjQuyDQodGC0L7Qu9C/0L7QstGB0LrQuNGF?= writes: I would like to offer my patch on the problem of removing values from enums It adds support for expression ALTER TYPE DROP VALUE This does not fix any of the hard problems that caused

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Tom Lane
=?UTF-8?B?0JTQsNC90LjQuyDQodGC0L7Qu9C/0L7QstGB0LrQuNGF?= writes: > I would like to offer my patch on the problem of removing values from enums > It adds support for expression ALTER TYPE DROP VALUE > This does not fix any of the hard problems that caused us not to have such a feature to begin

Re: Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Vik Fearing
On 9/28/23 14:13, Данил Столповских wrote: Greetings, everyone! I would like to offer my patch on the problem of removing values from enums It adds support for expression ALTER TYPE DROP VALUE Added: 1. expression in grammar 2. function to drop enum values 3. regression tests 4. documentation

Allow deleting enumerated values from an existing enumerated data type

2023-09-28 Thread Данил Столповских
Greetings, everyone! I would like to offer my patch on the problem of removing values from enums It adds support for expression ALTER TYPE DROP VALUE Added: 1. expression in grammar 2. function to drop enum values 3. regression tests 4. documentation Subject: [PATCH] Add DROP VALUE for ALTER TY