Re: Alter or rename enum value - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Alter or rename enum value
Date
Msg-id 3202.1459002341@sss.pgh.pa.us
Whole thread Raw
In response to Re: Alter or rename enum value  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Alter or rename enum value
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> We don't have the luxury of being able to redesign this as a green 
> fields development.

I'm not actually convinced that we need to do anything.  SQL already has a
perfectly good mechanism for enforcing that a column contains only values
of a mutable set defined in another table --- it's called a foreign key.
The point of inventing enums was to provide a lower-overhead solution
for cases where the allowed value set is *not* mutable.  So okay, if we
can allow certain cases of changing the value set without increasing
the overhead, great.  But when we can't do it without adding a whole
lot of complexity and overhead (and, no doubt, bugs), we need to just
say no.

Maybe the docs about enums need to be a little more explicit about
pointing out this tradeoff.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: If a schema is created as part of an extension, should all user created tables created in that schema be considered part of the extension?
Next
From: Andrew Dunstan
Date:
Subject: Re: Alter or rename enum value