DEV Community

tongxi
tongxi

Posted on

openGauss dolphin-keywords.

The SQL contains reserved and non-reserved words. Standards require that reserved keywords not be used as other identifiers. Non-reserved keywords have special meanings only in a specific environment and can be used as identifiers in other environments.

The naming rules for identifiers are as follows:

An identifier name can only contain letters, underscores, digits (0-9), and dollar signs ($).

An identifier name must start with a letter (a to z) or an underscore (_).

NOTE:

The naming rules are recommended but not mandatory.

In special cases, double quotation marks (") can be used to avoid special character errors.

Compared with the original openGauss, Dolphin modifies keywords as follows:

MEDIUMINT is added as a non-reserved keyword.
The keyword DATE can be used as a function.
LAST_DAY is added as a reserved keyword to distinguish the original LAST_DAY function of openGauss from the LAST_DAY function of Dolphin at the syntax level.
GET_FORMAT is added as a non-reserved keyword to identify the GET_FORMAT function in syntax.
DAY_HOUR, DAY_MINUTE, DAY_SECOND, DAY_MICROSECOND, HOUR_MINUTE, HOUR_SECOND, HOUR_MICROSECOND, MINUTE_SECOND, MINUTE_MICROSECOND, and SECOND_MICROSECOND are added as non-reserved keywords for the EXTRACT function to identify the corresponding unit in syntax.
Table 1 SQL keywords

Keyword

openGauss

SQL:1999

SQL-92

FORMAT

Non-reserved (excluding functions and types)

-

-

IF

Non-reserved (excluding functions and types)

-

-

KEYS

Non-reserved

-

-

MEDIUMINT

Non-reserved (excluding functions and types)

-

-

SIGNED

Non-reserved (excluding functions and types)

-

-

UNSIGNED

Non-reserved (excluding functions and types)

-

-

ZEROFILL

Non-reserved

-

-

DATE Non-reserved (excluding functions and types) - -
LAST_DAY Reserved - -
GET_FORMAT Non-reserved (excluding functions and types) - -
DAY_HOUR Non-reserved - -
DAY_MINUTE Non-reserved - -
DAY_SECOND Non-reserved - -
DAY_MICROSECOND Non-reserved - -
HOUR_MINUTE Non-reserved - -
HOUR_SECOND Non-reserved - -
HOUR_MICROSECOND Non-reserved - -
MINUTE_SECOND Non-reserved - -
MINUTE_MICROSECOND Non-reserved - -
SECOND_MICROSECOND Non-reserved - -

Top comments (0)