Valid characters in names
Keyspace and table names must begin with a letter, and they can contain letters, numbers, and underscores.
All other element names, such as columns and types, can contain any characters. However, if a name contains a special character, such as a period or hyphen, then you must enclose the name in double quotes.
Here are some examples of valid and invalid statements with special characters. These statements are truncated to focus on the use of special characters and double quotes.
// Valid statements
CREATE TABLE foo ...
CREATE TABLE foo_bar ...
CREATE TABLE foo ("what#*&" text, ...)
ALTER TABLE foo5 ...
CREATE FUNCTION "foo5$$${caret}%" ...
CREATE AGGREGATE "foo5!@#" ...
CREATE TYPE foo5 ("bar#9" text, ...)
// Invalid statements
// Table names can only include letters, numbers, and underscores
CREATE TABLE foo!$% ...
CREATE TABLE foo[]"90 ...
ALTER TABLE "foo5$$"...
// Element names with special characters must be enclosed in double quotes
CREATE TABLE foo (what#*& text, ...)
CREATE FUNCTION foo5$$...
CREATE AGGREGATE foo5$$
CREATE TYPE foo5 (bar#9 text, ...)