Keywords

The SQL contains reserved words 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.

Table 1 SQL keywords

Keyword

openGauss

SQL:1999

SQL-92

ABORT

Non-reserved

N/A

N/A

ABS

N/A

Non-reserved

N/A

ABSOLUTE

Non-reserved

Reserved

Reserved

ACCESS

Non-reserved

N/A

N/A

ACCOUNT

Non-reserved

N/A

N/A

ACTION

Non-reserved

Reserved

Reserved

ADA

N/A

Non-reserved

Non-reserved

ADD

Non-reserved

Reserved

Reserved

ADMIN

Non-reserved

Reserved

N/A

AFTER

Non-reserved

Reserved

N/A

AGGREGATE

Non-reserved

Reserved

N/A

ALGORITHM

Non-reserved

N/A

N/A

ALIAS

N/A

Reserved

N/A

ALL

Reserved

Reserved

Reserved

ALLOCATE

N/A

Reserved

Reserved

ALSO

Non-reserved

N/A

N/A

ALTER

Non-reserved

Reserved

Reserved

ALWAYS

Non-reserved

N/A

N/A

ANALYSE

Reserved

N/A

N/A

ANALYZE

Reserved

N/A

N/A

AND

Reserved

Reserved

Reserved

ANY

Reserved

Reserved

Reserved

APP

Non-reserved

N/A

N/A

ARE

N/A

Reserved

Reserved

ARRAY

Reserved

Reserved

N/A

AS

Reserved

Reserved

Reserved

ASC

Reserved

Reserved

Reserved

ASENSITIVE

N/A

Non-reserved

N/A

ASSERTION

Non-reserved

Reserved

Reserved

ASSIGNMENT

Non-reserved

Non-reserved

N/A

ASYMMETRIC

Reserved

Non-reserved

N/A

AT

Non-reserved

Reserved

Reserved

ATOMIC

N/A

Non-reserved

N/A

ATTRIBUTE

Non-reserved

N/A

N/A

AUTHID

Reserved

N/A

N/A

AUTHORIZATION

Reserved (functions and types allowed)

Reserved

Reserved

AUTOEXTEND

Non-reserved

N/A

N/A

AUTOMAPPED

Non-reserved

N/A

N/A

AVG

N/A

Non-reserved

Reserved

BACKWARD

Non-reserved

N/A

N/A

BARRIER

Non-reserved

N/A

N/A

BEFORE

Non-reserved

Reserved

N/A

BEGIN

Non-reserved

Reserved

Reserved

BEGIN_NON_ANOYBLOCK

Non-reserved

N/A

N/A

BETWEEN

Non-reserved (excluding functions and types)

Non-reserved

Reserved

BIGINT

Non-reserved (excluding functions and types)

N/A

N/A

BINARY

Reserved (functions and types allowed)

Reserved

N/A

BINARY_DOUBLE

Non-reserved (excluding functions and types)

N/A

N/A

BINARY_INTEGER

Non-reserved (excluding functions and types)

N/A

N/A

BIT

Non-reserved (excluding functions and types)

Reserved

Reserved

BITVAR

N/A

Non-reserved

N/A

BIT_LENGTH

N/A

Non-reserved

Reserved

BLOB

Non-reserved

Reserved

N/A

BOOLEAN

Non-reserved (excluding functions and types)

Reserved

N/A

BOTH

Reserved

Reserved

Reserved

BUCKETS

Reserved

N/A

N/A

BREADTH

N/A

Reserved

N/A

BY

Non-reserved

Reserved

Reserved

BYTEAWITHOUTODER

Non-reserved (excluding functions and types)

N/A

N/A

BYTEAWITHOUTORDERWITHEQUAL

Non-reserved (excluding functions and types)

N/A

N/A

C

N/A

Non-reserved

Non-reserved

CACHE

Non-reserved

N/A

N/A

CALL

Non-reserved

Reserved

N/A

CALLED

Non-reserved

Non-reserved

N/A

CARDINALITY

N/A

Non-reserved

N/A

CASCADE

Non-reserved

Reserved

Reserved

CASCADED

Non-reserved

Reserved

Reserved

CASE

Reserved

Reserved

Reserved

CAST

Reserved

Reserved

Reserved

CATALOG

Non-reserved

Reserved

Reserved

CATALOG_NAME

N/A

Non-reserved

Non-reserved

CHAIN

Non-reserved

Non-reserved

N/A

CHAR

Non-reserved (excluding functions and types)

Reserved

Reserved

CHARACTER

Non-reserved (excluding functions and types)

Reserved

Reserved

CHARACTERISTICS

Non-reserved

N/A

N/A

CHARACTER_LENGTH

N/A

Non-reserved

Reserved

CHARACTER_SET_CATALOG

N/A

Non-reserved

Non-reserved

CHARACTER_SET_NAME

N/A

Non-reserved

Non-reserved

CHARACTER_SET_SCHEMA

N/A

Non-reserved

Non-reserved

CHAR_LENGTH

N/A

Non-reserved

Reserved

CHECK

Reserved

Reserved

Reserved

CHECKED

N/A

Non-reserved

N/A

CHECKPOINT

Non-reserved

N/A

N/A

CLASS

Non-reserved

Reserved

N/A

CLEAN

Non-reserved

N/A

N/A

CLASS_ORIGIN

N/A

Non-reserved

Non-reserved

CLIENT

Non-reserved

N/A

N/A

CLIENT_MASTER_KEY

Non-reserved

N/A

N/A

CLIENT_MASTER_KEYS

Non-reserved

N/A

N/A

CLOB

Non-reserved

Reserved

N/A

CLOSE

Non-reserved

Reserved

Reserved

CLUSTER

Non-reserved

N/A

N/A

COALESCE

Non-reserved (excluding functions and types)

Non-reserved

Reserved

COBOL

N/A

Non-reserved

Non-reserved

COLLATE

Reserved

Reserved

Reserved

COLLATION

Reserved (functions and types allowed)

Reserved

Reserved

COLLATION_CATALOG

N/A

Non-reserved

Non-reserved

COLLATION_NAME

N/A

Non-reserved

Non-reserved

COLLATION_SCHEMA

N/A

Non-reserved

Non-reserved

COLUMN

Reserved

Reserved

Reserved

COLUMN_ENCRYPTION_KEY

Non-reserved

N/A

N/A

COLUMN_ENCRYPTION_KEYS

Non-reserved

N/A

N/A

COLUMN_NAME

N/A

Non-reserved

Non-reserved

COMPACT

Reserved (functions and types allowed)

N/A

N/A

COMPATIBLE_ILLEGAL_CHARS

Non-reserved

N/A

N/A

COMMAND_FUNCTION

N/A

Non-reserved

Non-reserved

COMPLETE

Non-reserved

N/A

N/A

COMMAND_FUNCTION_CODE

N/A

Non-reserved

N/A

COMMENT

Non-reserved

N/A

N/A

COMMENTS

Non-reserved

N/A

N/A

COMMIT

Non-reserved

Reserved

Reserved

COMMITTED

Non-reserved

Non-reserved

Non-reserved

COMPRESS

Non-reserved

N/A

N/A

COMPLETION

N/A

Reserved

N/A

CONCURRENTLY

Reserved (functions and types allowed)

N/A

N/A

CONDITION

N/A

N/A

N/A

CONDITION_NUMBER

N/A

Non-reserved

Non-reserved

CONFIGURATION

Non-reserved

N/A

N/A

CONNECT

N/A

Reserved

Reserved

CONNECTION

Non-reserved

Reserved

Reserved

CONNECTION_NAME

N/A

Non-reserved

Non-reserved

CONSTRAINT

Reserved

Reserved

Reserved

CONSTRAINTS

Non-reserved

Reserved

Reserved

CONSTRAINT_CATALOG

N/A

Non-reserved

Non-reserved

CONSTRAINT_NAME

N/A

Non-reserved

Non-reserved

CONSTRAINT_SCHEMA

N/A

Non-reserved

Non-reserved

CONSTRUCTOR

N/A

Reserved

N/A

CONTAINS

N/A

Non-reserved

N/A

CONTENT

Non-reserved

N/A

N/A

CONTINUE

Non-reserved

Reserved

Reserved

CONVERSION

Non-reserved

N/A

N/A

CONVERT

N/A

Non-reserved

Reserved

COPY

Non-reserved

N/A

N/A

CORRESPONDING

N/A

Reserved

Reserved

COST

Non-reserved

N/A

N/A

COUNT

N/A

Non-reserved

Reserved

CREATE

Reserved

Reserved

Reserved

CROSS

Reserved (functions and types allowed)

Reserved

Reserved

CSV

Non-reserved

N/A

N/A

CUBE

Non-reserved

Reserved

N/A

CURRENT

Non-reserved

Reserved

Reserved

CURRENT_CATALOG

Reserved

N/A

N/A

CURRENT_DATE

Reserved

Reserved

Reserved

CURRENT_PATH

N/A

Reserved

N/A

CURRENT_ROLE

Reserved

Reserved

N/A

CURRENT_SCHEMA

Reserved (functions and types allowed)

N/A

N/A

CURRENT_TIME

Reserved

Reserved

Reserved

CURRENT_TIMESTAMP

Reserved

Reserved

Reserved

CURRENT_USER

Reserved

Reserved

Reserved

CURSOR

Non-reserved

Reserved

Reserved

CURSOR_NAME

N/A

Non-reserved

Non-reserved

CYCLE

Non-reserved

Reserved

N/A

DATA

Non-reserved

Reserved

Non-reserved

DATABASE

Non-reserved

N/A

N/A

DATAFILE

Non-reserved

N/A

N/A

DATE_FORMAT

Non-reserved

N/A

N/A

DATATYPE_CL

Non-reserved

N/A

N/A

DATE

Non-reserved (excluding functions and types)

Reserved

Reserved

DELTAMERGE

Reserved (functions and types allowed)

N/A

N/A

DATETIME_INTERVAL_CODE

N/A

Non-reserved

Non-reserved

DATETIME_INTERVAL_PRECISION

N/A

Non-reserved

Non-reserved

DAY

Non-reserved

Reserved

Reserved

DBCOMPATIBILITY

Non-reserved

N/A

N/A

DEALLOCATE

Non-reserved

Reserved

Reserved

DEC

Non-reserved (excluding functions and types)

Reserved

Reserved

DECIMAL

Non-reserved (excluding functions and types)

Reserved

Reserved

DECLARE

Non-reserved

Reserved

Reserved

DECODE

Non-reserved (excluding functions and types)

N/A

N/A

DEFAULT

Reserved

Reserved

Reserved

DEFAULTS

Non-reserved

N/A

N/A

DEFERRABLE

Reserved

Reserved

Reserved

DEFERRED

Non-reserved

Reserved

Reserved

DEFINED

N/A

Non-reserved

N/A

DEFINER

Non-reserved

Non-reserved

N/A

DELETE

Non-reserved

Reserved

Reserved

DELIMITER

Non-reserved

N/A

N/A

DELIMITERS

Non-reserved

N/A

N/A

DELTA

Non-reserved

N/A

N/A

DEPTH

N/A

Reserved

N/A

DEREF

N/A

Reserved

N/A

DESC

Reserved

Reserved

Reserved

DESCRIBE

N/A

Reserved

Reserved

DESCRIPTOR

N/A

Reserved

Reserved

DESTROY

N/A

Reserved

N/A

DESTRUCTOR

N/A

Reserved

N/A

DETERMINISTIC

Non-reserved

Reserved

N/A

DIAGNOSTICS

N/A

Reserved

Reserved

DICTIONARY

Non-reserved

Reserved

N/A

DIRECT

Non-reserved

N/A

N/A

DIRECTORY

Non-reserved

N/A

N/A

DISABLE

Non-reserved

N/A

N/A

DISCARD

Non-reserved

N/A

N/A

DISCONNECT

Non-reserved

Reserved

Reserved

DISPATCH

N/A

Non-reserved

N/A

DISTINCT

Reserved

Reserved

Reserved

DISTRIBUTE

Non-reserved

N/A

N/A

DISTRIBUTION

Non-reserved

N/A

N/A

DO

Reserved

N/A

N/A

DOCUMENT

Non-reserved

N/A

N/A

DOMAIN

Non-reserved

Reserved

Reserved

DOUBLE

Non-reserved

Reserved

Reserved

DROP

Non-reserved

Reserved

Reserved

DUPLICATE

Non-reserved

N/A

N/A

DYNAMIC

N/A

Reserved

N/A

DYNAMIC_FUNCTION

N/A

Non-reserved

Non-reserved

DYNAMIC_FUNCTION_CODE

N/A

Non-reserved

N/A

EACH

Non-reserved

Reserved

N/A

ELSE

Reserved

Reserved

Reserved

ELASTIC

Non-reserved

N/A

N/A

ENABLE

Non-reserved

N/A

N/A

ENCODING

Non-reserved

N/A

N/A

ENCRYPTED

Non-reserved

N/A

N/A

ENCRYPTED_VALUE

Non-reserved

N/A

N/A

ENCRYPTION

Non-reserved

N/A

N/A

ENCRYPTION_TYPE

Non-reserved

N/A

N/A

END

Reserved

Reserved

Reserved

END-EXEC

N/A

Reserved

Reserved

ENFORCED

Non-reserved

N/A

N/A

ENUM

Non-reserved

N/A

N/A

EOL

Non-reserved

N/A

N/A

ERRORS

Non-reserved

N/A

N/A

EQUALS

N/A

Reserved

N/A

ESCAPE

Non-reserved

Reserved

Reserved

ESCAPING

Non-reserved

N/A

N/A

EVERY

Non-reserved

Reserved

N/A

EXCEPT

Reserved

Reserved

Reserved

EXCEPTION

N/A

Reserved

Reserved

EXCHANGE

Non-reserved

N/A

N/A

EXCLUDE

Non-reserved

N/A

N/A

EXCLUDED

Reserved

N/A

N/A

EXCLUDING

Non-reserved

N/A

N/A

EXCLUSIVE

Non-reserved

N/A

N/A

EXEC

N/A

Reserved

Reserved

EXECUTE

Non-reserved

Reserved

Reserved

EXISTING

N/A

Non-reserved

N/A

EXISTS

Non-reserved (excluding functions and types)

Non-reserved

Reserved

EXPIRED_P

Non-reserved

N/A

N/A

EXPLAIN

Non-reserved

N/A

N/A

EXTENSION

Non-reserved

N/A

N/A

EXTERNAL

Non-reserved

Reserved

Reserved

EXTRACT

Non-reserved (excluding functions and types)

Non-reserved

Reserved

FALSE

Reserved

Reserved

Reserved

FAMILY

Non-reserved

N/A

N/A

FAST

Non-reserved

N/A

N/A

FETCH

Reserved

Reserved

Reserved

FENCED

Reserved

N/A

N/A

FILEHEADER

Non-reserved

N/A

N/A

FINAL

N/A

Non-reserved

N/A

FIRST

Non-reserved

Reserved

Reserved

FIXED

Non-reserved

Reserved

Reserved

FILL_MISSING_FIELDS

Non-reserved

N/A

N/A

FLOAT

Non-reserved (excluding functions and types)

Reserved

Reserved

FOLLOWING

Non-reserved

N/A

N/A

FOR

Reserved

Reserved

Reserved

FORCE

Non-reserved

N/A

N/A

FOREIGN

Reserved

Reserved

Reserved

FORMATTER

Non-reserved

N/A

N/A

FORTRAN

N/A

Non-reserved

Non-reserved

FORWARD

Non-reserved

N/A

N/A

FOUND

N/A

Reserved

Reserved

FREE

N/A

Reserved

N/A

FREEZE

Reserved (functions and types allowed)

N/A

N/A

FROM

Reserved

Reserved

Reserved

FULL

Reserved (functions and types allowed)

Reserved

Reserved

FUNCTION

Non-reserved

Reserved

N/A

FUNCTIONS

Non-reserved

N/A

N/A

G

N/A

Non-reserved

N/A

GENERAL

N/A

Reserved

N/A

GENERATED

N/A

Non-reserved

N/A

GET

N/A

Reserved

Reserved

GLOBAL

Non-reserved

Reserved

Reserved

GO

N/A

Reserved

Reserved

GOTO

N/A

Reserved

Reserved

GRANT

Reserved

Reserved

Reserved

GRANTED

Non-reserved

Non-reserved

N/A

GREATEST

Non-reserved (excluding functions and types)

N/A

N/A

GROUP

Reserved

Reserved

Reserved

GROUPING

Non-reserved (excluding functions and types)

Reserved

N/A

HANDLER

Non-reserved

N/A

N/A

HAVING

Reserved

Reserved

Reserved

HDFSDIRECTORY

Reserved (functions and types allowed)

N/A

N/A

HEADER

Non-reserved

N/A

N/A

HIERARCHY

N/A

Non-reserved

N/A

HOLD

Non-reserved

Non-reserved

N/A

HOST

N/A

Reserved

N/A

HOUR

Non-reserved

Reserved

Reserved

IDENTIFIED

Non-reserved

N/A

N/A

IDENTITY

Non-reserved

Reserved

Reserved

IF

Non-reserved

N/A

N/A

IGNORE

N/A

Reserved

N/A

IGNORE_EXTRA_DATA

Non-reserved

N/A

N/A

ILIKE

Reserved (functions and types allowed)

N/A

N/A

IMMEDIATE

Non-reserved

Reserved

Reserved

IMMUTABLE

Non-reserved

N/A

N/A

IMPLEMENTATION

N/A

Non-reserved

N/A

IMPLICIT

Non-reserved

N/A

N/A

IN

Reserved

Reserved

Reserved

INTERNAL

Non-reserved

N/A

N/A

INCLUDING

Non-reserved

N/A

N/A

INCREMENT

Non-reserved

N/A

N/A

INDEX

Non-reserved

N/A

N/A

INDEXES

Non-reserved

N/A

N/A

INDICATOR

N/A

Reserved

Reserved

INFIX

N/A

Non-reserved

N/A

INHERIT

Non-reserved

N/A

N/A

INHERITS

Non-reserved

N/A

N/A

INITIAL

Non-reserved

N/A

N/A

INITIALIZE

N/A

Reserved

N/A

INITIALLY

Reserved

Reserved

Reserved

INITRANS

Non-reserved

N/A

N/A

INLINE

Non-reserved

N/A

N/A

INNER

Reserved (functions and types allowed)

Reserved

Reserved

INOUT

Non-reserved (excluding functions and types)

Reserved

N/A

INPUT

Non-reserved

Reserved

Reserved

INSENSITIVE

Non-reserved

Non-reserved

Reserved

INSERT

Non-reserved

Reserved

Reserved

INSTANCE

N/A

Non-reserved

N/A

INSTANTIABLE

N/A

Non-reserved

N/A

INSTEAD

Non-reserved

N/A

N/A

INT

Non-reserved (excluding functions and types)

Reserved

Reserved

INTEGER

Non-reserved (excluding functions and types)

Reserved

Reserved

INTERSECT

Reserved

Reserved

Reserved

INTERVAL

Non-reserved (excluding functions and types)

Reserved

Reserved

INTO

Reserved

Reserved

Reserved

INVOKER

Non-reserved

Non-reserved

N/A

IS

Reserved

Reserved

Reserved

ISNULL

Non-reserved

N/A

N/A

ISOLATION

Non-reserved

Reserved

Reserved

ITERATE

N/A

Reserved

N/A

JOIN

Reserved (functions and types allowed)

Reserved

Reserved

K

N/A

Non-reserved

N/A

KEY

Non-reserved

Reserved

Reserved

KEY_PATH

Non-reserved

N/A

N/A

KEY_MEMBER

N/A

Non-reserved

N/A

KEY_STORE

Non-reserved

N/A

N/A

KEY_TYPE

N/A

Non-reserved

N/A

KILL

Non-reserved

N/A

N/A

LABEL

Non-reserved

N/A

N/A

LANGUAGE

Non-reserved

Reserved

Reserved

LARGE

Non-reserved

Reserved

N/A

LAST

Non-reserved

Reserved

Reserved

LATERAL

N/A

Reserved

N/A

LC_COLLATE

Non-reserved

N/A

N/A

LC_CTYPE

Non-reserved

N/A

N/A

LEADING

Reserved

Reserved

Reserved

LEAKPROOF

Non-reserved

N/A

N/A

LEAST

Non-reserved (excluding functions and types)

N/A

N/A

LEFT

Reserved (functions and types allowed)

Reserved

Reserved

LENGTH

N/A

Non-reserved

Non-reserved

LESS

Reserved

Reserved

N/A

LEVEL

Non-reserved

Reserved

Reserved

LIKE

Reserved (functions and types allowed)

Reserved

Reserved

LIMIT

Reserved

Reserved

N/A

LISTEN

Non-reserved

N/A

N/A

LOAD

Non-reserved

N/A

N/A

LOCAL

Non-reserved

Reserved

Reserved

LOCALTIME

Reserved

Reserved

N/A

LOCALTIMESTAMP

Reserved

Reserved

N/A

LOCATION

Non-reserved

N/A

N/A

LOCATOR

N/A

Reserved

N/A

LOCK

Non-reserved

N/A

N/A

LOG

Non-reserved

N/A

N/A

LOGGING

Non-reserved

N/A

N/A

LOOP

Non-reserved

N/A

N/A

LOWER

N/A

Non-reserved

Reserved

MAP

N/A

Reserved

N/A

MAPPING

Non-reserved

N/A

N/A

MASTER

Non-reserved

N/A

N/A

MATCH

Non-reserved

Reserved

Reserved

MATCHED

Non-reserved

N/A

N/A

MAX

N/A

Non-reserved

Reserved

MAXEXTENTS

Non-reserved

N/A

N/A

MAXSIZE

Non-reserved

N/A

N/A

MAXTRANS

Non-reserved

N/A

N/A

MAXVALUE

Reserved

N/A

N/A

MERGE

Non-reserved

N/A

N/A

MESSAGE_LENGTH

N/A

Non-reserved

Non-reserved

MESSAGE_OCTET_LENGTH

N/A

Non-reserved

Non-reserved

MESSAGE_TEXT

N/A

Non-reserved

Non-reserved

METHOD

N/A

Non-reserved

N/A

MIN

N/A

Non-reserved

Reserved

MINEXTENTS

Non-reserved

N/A

N/A

MINUS

Reserved

N/A

N/A

MINUTE

Non-reserved

Reserved

Reserved

MINVALUE

Non-reserved

N/A

N/A

MOD

N/A

Non-reserved

N/A

MODE

Non-reserved

N/A

N/A

MODIFIES

N/A

Reserved

N/A

MODIFY

Reserved

Reserved

N/A

MODULE

N/A

Reserved

Reserved

MONTH

Non-reserved

Reserved

Reserved

MORE

N/A

Non-reserved

Non-reserved

MOVE

Non-reserved

N/A

N/A

MOVEMENT

Non-reserved

N/A

N/A

MUMPS

N/A

Non-reserved

Non-reserved

NAME

Non-reserved

Non-reserved

Non-reserved

NAMES

Non-reserved

Reserved

Reserved

NATIONAL

Non-reserved (excluding functions and types)

Reserved

Reserved

NATURAL

Reserved (functions and types allowed)

Reserved

Reserved

NCHAR

Non-reserved (excluding functions and types)

Reserved

Reserved

NCLOB

N/A

Reserved

N/A

NEW

N/A

Reserved

N/A

NEXT

Non-reserved

Reserved

Reserved

NO

Non-reserved

Reserved

Reserved

NOCOMPRESS

Non-reserved

N/A

N/A

NOCYCLE

Non-reserved

N/A

N/A

NODE

Non-reserved

N/A

N/A

NOLOGGING

Non-reserved

N/A

N/A

NOMAXVALUE

Non-reserved

N/A

N/A

NOMINVALUE

Non-reserved

N/A

N/A

NONE

Non-reserved (excluding functions and types)

Reserved

N/A

NOT

Reserved

Reserved

Reserved

NOTHING

Non-reserved

N/A

N/A

NOTIFY

Non-reserved

N/A

N/A

NOTNULL

Reserved (functions and types allowed)

N/A

N/A

NOWAIT

Non-reserved

N/A

N/A

NULL

Reserved

Reserved

Reserved

NULLABLE

N/A

Non-reserved

Non-reserved

NULLIF

Non-reserved (excluding functions and types)

Non-reserved

Reserved

NULLS

Non-reserved

N/A

N/A

NUMBER