VARCHAR as an alternative
suggest changeLet’s say we have
type ENUM('fish','mammal','bird')
An alternative is
type VARCHAR(20) COMENT "fish, bird, etc"
This is quite open-ended in that new types are trivially added.
Comparison, and whether better or worse than ENUM:
- (same) INSERT: simply provide the string
- (worse?) On INSERT a typo will go unnoticed
- (same) SELECT: the actual string is returned
- (worse) A lot more space is consumed
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents