Back to Trino

Keywords and identifiers

docs/src/main/sphinx/language/reserved.md

4804.8 KB
Original Source

Keywords and identifiers

(language-keywords)=

Reserved keywords

The following table lists all the keywords that are reserved in Trino, along with their status in the SQL standard. These reserved keywords must be quoted (using double quotes) in order to be used as an identifier.

KeywordSQL:2016SQL-92
ALTERreservedreserved
ANDreservedreserved
ASreservedreserved
AUTO
BETWEENreservedreserved
BYreservedreserved
CASEreservedreserved
CASTreservedreserved
CONSTRAINTreservedreserved
CREATEreservedreserved
CROSSreservedreserved
CUBEreserved
CURRENT_CATALOGreserved
CURRENT_DATEreservedreserved
CURRENT_PATHreserved
CURRENT_ROLEreservedreserved
CURRENT_SCHEMAreserved
CURRENT_TIMEreservedreserved
CURRENT_TIMESTAMPreservedreserved
CURRENT_USERreserved
DEALLOCATEreservedreserved
DELETEreservedreserved
DESCRIBEreservedreserved
DISTINCTreservedreserved
DROPreservedreserved
ELSEreservedreserved
ENDreservedreserved
ESCAPEreservedreserved
EXCEPTreservedreserved
EXISTSreservedreserved
EXTRACTreservedreserved
FALSEreservedreserved
FORreservedreserved
FROMreservedreserved
FULLreservedreserved
GROUPreservedreserved
GROUPINGreserved
HAVINGreservedreserved
INreservedreserved
INNERreservedreserved
INSERTreservedreserved
INTERSECTreservedreserved
INTOreservedreserved
ISreservedreserved
JOINreservedreserved
JSON_ARRAYreserved
JSON_EXISTSreserved
JSON_OBJECTreserved
JSON_QUERYreserved
JSON_TABLEreserved
JSON_VALUEreserved
LEFTreservedreserved
LIKEreservedreserved
LISTAGGreserved
LOCALTIMEreserved
LOCALTIMESTAMPreserved
NATURALreservedreserved
NORMALIZEreserved
NOTreservedreserved
NULLreservedreserved
ONreservedreserved
ORreservedreserved
ORDERreservedreserved
OUTERreservedreserved
PREPAREreservedreserved
RECURSIVEreserved
RIGHTreservedreserved
ROLLUPreserved
SELECTreservedreserved
SKIPreserved
TABLEreservedreserved
THENreservedreserved
TRIMreservedreserved
TRUEreservedreserved
UESCAPEreserved
UNIONreservedreserved
UNNESTreserved
USINGreservedreserved
VALUESreservedreserved
WHENreservedreserved
WHEREreservedreserved
WITHreservedreserved

(language-identifiers)=

Identifiers

Tokens that identify names of catalogs, schemas, tables, columns, functions, or other objects, are identifiers.

Identifiers must start with a letter, and subsequently include alphanumeric characters and underscores. Identifiers with other characters must be delimited with double quotes ("). When delimited with double quotes, identifiers can use any character. Escape a " with another preceding double quote in a delimited identifier.

Identifiers are not treated as case sensitive.

Following are some valid examples:

sql
tablename
SchemaName
example_catalog.a_schema."table$partitions"
"identifierWith""double""quotes"

The following identifiers are invalid in Trino and must be quoted when used:

text
table-name
123SchemaName
colum$name@field