Tom Lane wrote:

(Hmm, I wonder what Tom Dunstan's enum patch does about case

Currently enum labels are case sensitive. I was a bit ambivalent about it... case insensitivity can lead to less surprises in some cases, but many programming languages that have enums are case sensitive, and so this wouldn't be a direct map for them. OTOH, if someone's doing evil things like sticking labels that differ only in case into an enum, perhaps they *should* be dissuaded. :)

The question is where does it end, though? Should we treat letters with accents and umlauts as equivalent as well? Do we remove punctuation characters? It gets into a (for me) more murky localization issue, and I'm not familiar with the postgresql apis for handling that. Maybe it's easy.

Since we basically accept any old thing into an enum label, I think we probably shouldn't muck with it. If we want to have some sort of normalized version, then we should probably restrict the characters that we accept fairly severely.

Also note that enum values are far more likely to be set by application code than by a human typing the value in directly, so in that sense the need for case insensitivity seems somewhat diminished.

I suppose we should think about mysql refugees at some point, though. I wonder what they do. The documentation is silent on the matter (and all their examples are in lower case). Mysql is generally case insensitive, right?



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?


Reply via email to