Object Identifier
Description
Each database object, such as tables, columns, and indexes, has a name. In SQL statements, these names are referred to as object identifiers. Identifiers can be quoted or unquoted. Quote permitted special characters or reserved keywords with backticks (`) each time the identifier is referenced. Quoting does not bypass the naming restrictions below. For more details on reserved keywords, please refer to the Reserved Keywords section.
Object Identifier Restrictions
The enable_unicode_name_support session variable controls Unicode support in object identifiers. The permitted characters, punctuation, and length restrictions depend on the object type, as described below.
In VeloDB Cloud, different objects have different restrictions on identifiers, and the specific restrictions for different objects are listed below.
Table names
With Unicode mode disabled, table names match ^[a-zA-Z0-9\\-_$]*$ and must be nonempty. With Unicode mode enabled, names can contain Unicode characters but cannot end in whitespace. Names containing punctuation or spaces need quoting. The service-managed table_name_length_limit has a compiled default of 64 characters. Table names cannot contain the reserved temporary-table marker _#TEMP#_.
Column names
Column names are 1-256 characters long and cannot end in whitespace. Unicode mode permits Unicode characters. With Unicode mode disabled, permitted characters are letters, digits, spaces within the name, and the punctuation . _ + - / ? @ # $ % ^ & * " , :. System and schema-change prefixes remain reserved. Quoting is required when the SQL lexer cannot treat the name as an ordinary identifier.
OUTFILE Names
| Mode | Identifier Restrictions |
|---|---|
| Closed Unicode Mode | ^[_a-zA-Z][a-zA-Z0-9\\-_]{0,63}$ |
| Enabled Unicode Mode | ^[_a-zA-Z\\p{L}][a-zA-Z0-9\\-_\\p{L}]{0,63}$ |
User Names
| Mode | Identifier Restrictions |
|---|---|
| Closed Unicode Mode | ^[a-zA-Z][a-zA-Z0-9.\\-_]*$ |
| Enabled Unicode Mode | ^[a-zA-Z\\p{L}][a-zA-Z0-9.\\-_\\p{L}]*$ |
LABEL Names
| Mode | Identifier Restrictions |
|---|---|
| Closed Unicode Mode | ^[-_A-Za-z0-9:]{1,N}$, where N is determined by the label_regex_length service-managed FE configuration, whose compiled default is 128. |
| Enabled Unicode Mode | ^[\\-_A-Za-z0-9:\\p{L}]{1,N}$, where N is determined by the label_regex_length service-managed FE configuration, whose compiled default is 128. |
Others
| Mode | Identifier Restrictions |
|---|---|
| Closed Unicode Mode | ^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$ |
| Enabled Unicode Mode | ^[a-zA-Z\\p{L}][a-zA-Z0-9\\-_\\p{L}]{0,63}$ |