What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I encountered an error while editing a question. The error was:

"A question with that title already exists"

The only edit I had made was to change the case of some of the letters to make the question look less sloppy.

I figure there is a possibility that the designers did not intend for the title comparison to be case sensitive. That is, perhaps the error should have come up when the question was first created because a case-insensitive search would have flagged the duplicate?

share|improve this question
    
I wonder if this is because running TOLOWER() or TOUPPER() (etc.) on every title in the database would be so expensive. They could store a single-cased version, I suppose, but that would require extra code and changing the db table(s). Or perhaps I'm ignorant and SQL make such comparisons quick, and it will be an easy fix :P –  Matthew Read Mar 7 '12 at 5:22
    
@MatthewRead: Generally for cases like this in SQL, you have a sort name which is TOUPPER or TOLOWER of the title after stripping punctuation, and it's created at the same time as the question (either in the question table or in a separate names table which just contains question ID and then name, sort name). When you query on a name you look for existingSortName == TOLOWER(newName). Oh, and the sortName field is indexed, for performance reasons. –  darvids0n Mar 7 '12 at 5:45
    
@Matthew, as far as I know, the default collation for SQL Server even yields case insensitive searches. –  Arjan Mar 7 '12 at 23:35

You must log in to answer this question.

Browse other questions tagged .