Re: Allow deleting enum value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maksim Kita <kitaetoya(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Allow deleting enum value
Date: 2020-10-07 16:03:15
Message-ID: 2191224.1602086595@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2020-10-07 16:30:32 Re: [PATCH] Automatic HASH and LIST partition creation
Previous Message Tom Lane 2020-10-07 15:23:34 Re: Allow deleting enum value