Until v. 9.1 enum modification was not officially supported, although hacking 
pg_enum made it somewhat workable. Since v. 9.1 there is a way to add values to 
enum types. However,

- alter type ... add value doesn't work in transaction blocks, which severely 
limits its usefulness
- there is still no supported way to delete values from an enum

Worse still, old hacks for adding enum values no longer work. There are some 
good technical reasons for all this, which, for those who are interested, have 
been discussed recently in psql-bugs.

All the same, I think a better support for enum modification would be very 
desirable, more so than for other custom types.  The reason has to do with the 
very nature of an enum - an enumeration, a representation of a set, which, in 
general, implies open-endedness.  Some sets that may be represented by an enum 
do not imply extensibility, e.g. days of the week (barring another French 
revolution!)  But many more do.  In my practice, when considering 
implementation of a set-like entity, extensibility is a crucial consideration.

For those interested in the discussion that led to this post, look for 
"Problems with ENUM type manipulation in 9.1" thread in psql-bugs.

Dmitry Epstein | Developer
 
Allied Testing
T + 7 495 544 48 69 Ext 417

www.alliedtesting.com
We Deliver Quality.



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to