HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

MySQL case sensitivity for table names

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
casenamessensitivitymysqlfortable

Problem

Why is it that different platforms (linux vs windows) does not support the same naming conventions? I'm stunned by the fact that the documentation uses file names as an excuse for this.

Yes, windows is not case sensitive for file names but one would think the developers would accommodate for this. I (personal preference) despise the under_score_convention and prefer camelCaseConvention.

Is there a way to enable the camel case sensitivity when connecting to the database, or is this something that has to be done in the default configuration?

Are there alternatives to MySQL that support the camelCaseConvention as per default on all platforms?

Edit

Ok, I feel a bit stupid now, I updated to mysql 5.5 and the camel-case convention is now supported, by lowering the entire name. It does not however preserve the camel-case, which is part of what I'm looking for.

Solution

The SQL standard defines that identifiers are not case sensitive (unless double-quoted: "CamelCase"). Your desire for CamelCase (mixed-case) names conflicts with the standard and you'd better learn to live with it. Or you start double-quoting your identifiers and never forget to do so.

Most RDBMS actually implement standard(-like) behavior. Even MySQL tries, lately, but it's very hard to break with established syntax rules.
Resources

  • MySQL manual on this topic.



  • Related article running a test case against the most popular RDBMS.



  • A list of how the most prevalent SQL dialects deal with delimited identifiers in wikibooks.

Context

StackExchange Database Administrators Q#34106, answer score: 8

Revisions (0)

No revisions yet.