-2

Could it cause problems to name a table using middle dots, like this:

tbl_prod·prov;
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
oxk4r
  • 452
  • 6
  • 17
  • 1
    What happened when you tried it that way? :) – Alfabravo Jun 07 '18 at 16:47
  • 2
    Yes, it could. It's likely to hurt your reputation as a developer if someone else takes a look at your database/code in the future. (It's also time to ditch the long-outdated `tbl_` naming convention.) – ceejayoz Jun 07 '18 at 16:48
  • In principle, nothing. – oxk4r Jun 07 '18 at 16:49
  • @ceejayoz, That is a very arrogant and subjective point of view, which I do not think can be considered good practice either. As far as I know, not everyone uses the same conventions in a strict manner, but adapts them in the way that they consider most appropriate, right? Thank you anyway ;) – oxk4r Jun 07 '18 at 17:21
  • 1
    My standard for code is that it should generate as few "what the fuck?"s as possible. Seeing a middot used in a table name would most certainly increment the count. `tbl_` in a table name is less of a "WTF" and more of a . It's just redundant. – ceejayoz Jun 07 '18 at 17:26

1 Answers1

2

The rules are explained at Schema Object Names:

Identifiers are converted to Unicode internally. They may contain these characters:

  • Permitted characters in unquoted identifiers:

    • ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore)

    • Extended: U+0080 .. U+FFFF

  • Permitted characters in quoted identifiers include the full Unicode Basic Multilingual Plane (BMP), except U+0000:

    • ASCII: U+0001 .. U+007F

    • Extended: U+0080 .. U+FFFF

  • ASCII NUL (U+0000) and supplementary characters (U+10000 and higher) are not permitted in quoted or unquoted identifiers.

  • Identifiers may begin with a digit but unless quoted may not consist solely of digits.
  • Database, table, and column names cannot end with space characters.

The · character is U+00B7 MIDDLE DOT so it fits the definition for Extended in quoted identifiers.

Said that, I can think of two potential problems:

  • Object names sometimes needs to be mapped to filesystem objects. We can speculate that MySQL has done things right in all supported platforms but it makes me feel uneasy.

  • If you happen to run a SQL query in a client/connection that's not correctly configured, or you paste the query from the clipboard, you risk using the wrong character.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360