Re: Allow deleting enum value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Allow deleting enum value
Дата
Msg-id 2191224.1602086595@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Allow deleting enum value  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Allow deleting enum value  (Maksim Kita <kitaetoya@gmail.com>)
Список pgsql-hackers
I wrote:
> That TODO item should either be removed or marked with a warning stating
> that it's next door to impossible.  (Unfortunately, a lot of our TODO
> items are like that ... there's usually a good reason why they're not
> done already.)

Actually ... I'm not sure if this idea has been discussed before, but
what if we redefined what "delete" means?  We could add an "isdropped"
column to pg_enum, and have DROP do nothing but set that flag, and
modify enum_in to reject such values.  Then comparisons still work,
and whether there are remaining instances of the value is the
user's problem not ours.

pg_dump and pg_upgrade would need to jump through some hoops to
deal with this, but it's not any harder than a lot of other
weird cases they deal with.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Allow deleting enum value
Следующее
От: Pavel Borisov
Дата:
Сообщение: Re: [PATCH] Automatic HASH and LIST partition creation