Re: Allow deleting enum value - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allow deleting enum value
Date
Msg-id 2191224.1602086595@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allow deleting enum value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Allow deleting enum value  (Maksim Kita <kitaetoya@gmail.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Allow deleting enum value
Next
From: Pavel Borisov
Date:
Subject: Re: [PATCH] Automatic HASH and LIST partition creation