SQL Grammar

Tip:

This page describes the full CockroachDB SQL grammar. However, as a starting point, it's best to reference our SQL statements pages first, which provide detailed explanations and examples.

stmt_block:

stmt
no references

stmt:

HELPTOKENpreparable_stmtcopy_from_stmtcomment_stmtexecute_stmtdeallocate_stmtdiscard_stmtexport_stmtgrant_stmtprepare_stmtrevoke_stmtsavepoint_stmtrelease_stmtnonpreparable_set_stmttransaction_stmt
referenced by:

preparable_stmt:

alter_stmtbackup_stmtcancel_stmtcreate_stmtdelete_stmtdrop_stmtexplain_stmtimport_stmtinsert_stmtpause_stmtreset_stmtrestore_stmtresume_stmtscrub_stmtselect_stmtpreparable_set_stmtshow_stmttruncate_stmtupdate_stmtupsert_stmt
referenced by:

copy_from_stmt:

COPYtable_nameopt_column_listFROMSTDIN
referenced by:

comment_stmt:

COMMENTONDATABASEdatabase_nameTABLEtable_nameCOLUMNcolumn_pathIScomment_text
referenced by:

execute_stmt:

EXECUTEtable_alias_nameexecute_param_clause
referenced by:

deallocate_stmt:

DEALLOCATEPREPAREnameALL
referenced by:

discard_stmt:

DISCARDALL
referenced by:

export_stmt:

EXPORTINTOimport_formatstring_or_placeholderopt_with_optionsFROMselect_stmt
referenced by:

grant_stmt:

GRANTprivilegesONtargetsTOname_listprivilege_listTOname_listWITHADMINOPTION
referenced by:

prepare_stmt:

PREPAREtable_alias_nameprep_type_clauseASpreparable_stmt
referenced by:

revoke_stmt:

REVOKEprivilegesONtargetsADMINOPTIONFORprivilege_listFROMname_list
referenced by:

savepoint_stmt:

SAVEPOINTname
referenced by:

release_stmt:

RELEASEsavepoint_name
referenced by:

nonpreparable_set_stmt:

set_transaction_stmt
referenced by:

transaction_stmt:

begin_stmtcommit_stmtrollback_stmtabort_stmt
referenced by:

alter_stmt:

alter_ddl_stmtalter_user_stmt
referenced by:

backup_stmt:

BACKUPtargetsTOstring_or_placeholderopt_as_of_clauseopt_incrementalopt_with_options
referenced by:

cancel_stmt:

cancel_jobs_stmtcancel_queries_stmtcancel_sessions_stmt
referenced by:

create_stmt:

create_user_stmtcreate_role_stmtcreate_ddl_stmtcreate_stats_stmt
referenced by:

delete_stmt:

opt_with_clauseDELETEFROMtable_name_expr_opt_alias_idxopt_where_clauseopt_sort_clauseopt_limit_clausereturning_clause
referenced by:

drop_stmt:

drop_ddl_stmtdrop_role_stmtdrop_user_stmt
referenced by:

explain_stmt:

EXPLAINANALYZE(explain_option_list)preparable_stmt
referenced by:

import_stmt:

IMPORTimport_formatstring_or_placeholderTABLEtable_nameFROMimport_formatstring_or_placeholderCREATEUSINGstring_or_placeholder(table_elem_list)import_formatDATA(string_or_placeholder_list)opt_with_options
referenced by:

insert_stmt:

opt_with_clauseINSERTINTOinsert_targetinsert_reston_conflictreturning_clause
referenced by:

pause_stmt:

PAUSEJOBa_exprJOBSselect_stmt
referenced by:

reset_stmt:

reset_session_stmtreset_csetting_stmt
referenced by:

restore_stmt:

RESTOREtargetsFROMstring_or_placeholder_listas_of_clauseopt_with_options
referenced by:

resume_stmt:

RESUMEJOBa_exprJOBSselect_stmt
referenced by:

scrub_stmt:

scrub_table_stmtscrub_database_stmt
referenced by:

select_stmt:

select_no_parensselect_with_parens
referenced by:

preparable_set_stmt:

set_session_stmtset_csetting_stmtuse_stmt
referenced by:

show_stmt:

show_backup_stmtshow_columns_stmtshow_constraints_stmtshow_create_stmtshow_csettings_stmtshow_databases_stmtshow_grants_stmtshow_indexes_stmtshow_jobs_stmtshow_queries_stmtshow_ranges_stmtshow_roles_stmtshow_schemas_stmtshow_sequences_stmtshow_session_stmtshow_sessions_stmtshow_stats_stmtshow_tables_stmtshow_trace_stmtshow_users_stmtshow_zone_stmt
referenced by:

truncate_stmt:

TRUNCATEopt_tablerelation_expr_listopt_drop_behavior
referenced by:

update_stmt:

opt_with_clauseUPDATEtable_name_expr_opt_alias_idxSETset_clause_listopt_where_clauseopt_sort_clauseopt_limit_clausereturning_clause
referenced by:

upsert_stmt:

opt_with_clauseUPSERTINTOinsert_targetinsert_restreturning_clause
referenced by:

table_name:

db_object_name
referenced by:

opt_column_list:

(name_list)
referenced by:

database_name:

name
referenced by:

comment_text:

SCONSTNULL
referenced by:

column_path:

nameprefixed_column_path
referenced by:

table_alias_name:

name
referenced by:

execute_param_clause:

(expr_list)
referenced by:

name:

identifierunreserved_keywordcol_name_keyword
referenced by:

import_format:

name
referenced by:

string_or_placeholder:

non_reserved_word_or_sconstPLACEHOLDER
referenced by:

opt_with_options:

WITHkv_option_listOPTIONS(kv_option_list)
referenced by:

privileges:

ALLprivilege_list
referenced by:

targets:

identifiercol_name_keywordunreserved_keywordcomplex_table_patterntable_pattern,TABLEtable_pattern_listDATABASEname_list
referenced by:

name_list:

name,
referenced by:

privilege_list:

privilege,
referenced by:

prep_type_clause:

(type_list)
referenced by:

savepoint_name:

SAVEPOINTname
referenced by:

set_transaction_stmt:

SETSESSIONTRANSACTIONtransaction_mode_list
referenced by:

begin_stmt:

BEGINopt_transactionSTARTTRANSACTIONbegin_transaction
referenced by:

commit_stmt:

COMMITENDopt_transaction
referenced by:

rollback_stmt:

ROLLBACKopt_to_savepoint
referenced by:

abort_stmt:

ABORTopt_abort_mod
referenced by:

alter_ddl_stmt:

alter_table_stmtalter_index_stmtalter_view_stmtalter_sequence_stmtalter_database_stmtalter_range_stmt
referenced by:

alter_user_stmt:

alter_user_password_stmt
referenced by:

opt_as_of_clause:

as_of_clause
referenced by:

opt_incremental:

INCREMENTALFROMstring_or_placeholder_list
referenced by:

cancel_jobs_stmt:

CANCELJOBa_exprJOBSselect_stmt
referenced by:

cancel_queries_stmt:

CANCELQUERYIFEXISTSa_exprQUERIESIFEXISTSselect_stmt
referenced by:

cancel_sessions_stmt:

CANCELSESSIONIFEXISTSa_exprSESSIONSIFEXISTSselect_stmt
referenced by:

create_user_stmt:

CREATEUSERIFNOTEXISTSstring_or_placeholderopt_password
referenced by:

create_role_stmt:

CREATEROLEIFNOTEXISTSstring_or_placeholder
referenced by:

create_ddl_stmt:

create_changefeed_stmtcreate_database_stmtcreate_index_stmtcreate_table_stmtcreate_table_as_stmtcreate_view_stmtcreate_sequence_stmt
referenced by:

create_stats_stmt:

CREATESTATISTICSstatistics_nameopt_stats_columnsFROMcreate_stats_targetopt_create_stats_options
referenced by:

opt_with_clause:

with_clause
referenced by:

table_name_expr_opt_alias_idx:

table_name_expr_with_indexAStable_alias_name
referenced by:

opt_where_clause:

where_clause
referenced by:

opt_sort_clause:

sort_clause
referenced by:

opt_limit_clause:

limit_clause
referenced by:

returning_clause:

RETURNINGtarget_listNOTHING
referenced by:

drop_ddl_stmt:

drop_database_stmtdrop_index_stmtdrop_table_stmtdrop_view_stmtdrop_sequence_stmt
referenced by:

drop_role_stmt:

DROPROLEIFEXISTSstring_or_placeholder_list
referenced by:

drop_user_stmt:

DROPUSERIFEXISTSstring_or_placeholder_list
referenced by:

explain_option_list:

explain_option_name,
referenced by:

string_or_placeholder_list:

string_or_placeholder,
referenced by:

table_elem_list:

table_elem,
referenced by:

insert_target:

table_nameAStable_alias_name
referenced by:

insert_rest:

(insert_column_list)select_stmtDEFAULTVALUES
referenced by:

on_conflict:

ONCONFLICTopt_conf_exprDOUPDATESETset_clause_listopt_where_clauseNOTHING
referenced by:

a_expr:

c_expr+-~NOTa_exprDEFAULTTYPECASTcast_targetTYPEANNOTATEtypenameCOLLATEcollation_name+a_expr-a_expr*a_expr/a_exprFLOORDIVa_expr%a_expr^a_expr#a_expr&a_expr|a_expr<a_expr>a_expr?a_exprJSON_SOME_EXISTSa_exprJSON_ALL_EXISTSa_exprCONTAINSa_exprCONTAINED_BYa_expr=a_exprCONCATa_exprLSHIFTa_exprRSHIFTa_exprFETCHVALa_exprFETCHTEXTa_exprFETCHVAL_PATHa_exprFETCHTEXT_PATHa_exprREMOVE_PATHa_exprINET_CONTAINED_BY_OR_EQUALSa_exprINET_CONTAINS_OR_CONTAINED_BYa_exprINET_CONTAINS_OR_EQUALSa_exprLESS_EQUALSa_exprGREATER_EQUALSa_exprNOT_EQUALSa_exprANDa_exprORa_exprLIKEa_exprLIKEa_exprESCAPEa_exprNOTLIKEa_exprNOTLIKEa_exprESCAPEa_exprILIKEa_exprILIKEa_exprESCAPEa_exprNOTILIKEa_exprNOTILIKEa_exprESCAPEa_exprSIMILARTOa_exprSIMILARTOa_exprESCAPEa_exprNOTSIMILARTOa_exprNOTSIMILARTOa_exprESCAPEa_expr~a_exprNOT_REGMATCHa_exprREGIMATCHa_exprNOT_REGIMATCHa_exprISNANISNOTNANISNULLISNULLISNOTNULLNOTNULLISTRUEISNOTTRUEISFALSEISNOTFALSEISUNKNOWNISNOTUNKNOWNISDISTINCTFROMa_exprISNOTDISTINCTFROMa_exprISOF(type_list)ISNOTOF(type_list)BETWEENopt_asymmetricb_exprANDa_exprNOTBETWEENopt_asymmetricb_exprANDa_exprBETWEENSYMMETRICb_exprANDa_exprNOTBETWEENSYMMETRICb_exprANDa_exprINin_exprNOTINin_exprsubquery_opsub_typea_expr
referenced by:

reset_session_stmt:

RESETSESSIONsession_var
referenced by:

reset_csetting_stmt:

RESETCLUSTERSETTINGvar_name
referenced by:

as_of_clause:

ASOFSYSTEMTIMEa_expr
referenced by:

scrub_table_stmt:

EXPERIMENTALSCRUBTABLEtable_nameopt_as_of_clauseopt_scrub_options_clause
referenced by:

scrub_database_stmt:

EXPERIMENTALSCRUBDATABASEdatabase_nameopt_as_of_clause
referenced by:

select_no_parens:

simple_selectselect_clausesort_clauseopt_sort_clauseselect_limitwith_clauseselect_clausesort_clauseopt_sort_clauseselect_limit
referenced by:

select_with_parens:

(select_no_parensselect_with_parens)
referenced by:

set_session_stmt:

SETSESSIONset_rest_moreCHARACTERISTICSASTRANSACTIONtransaction_mode_listset_rest_more
referenced by:

set_csetting_stmt:

SETCLUSTERSETTINGvar_nameto_or_eqvar_value
referenced by:

use_stmt:

USEvar_value
referenced by:

show_backup_stmt:

SHOWBACKUPstring_or_placeholder
referenced by:

show_columns_stmt:

SHOWCOLUMNSFROMtable_name
referenced by:

show_constraints_stmt:

SHOWCONSTRAINTCONSTRAINTSFROMtable_name
referenced by:

show_create_stmt:

SHOWCREATEtable_name
referenced by:

show_csettings_stmt:

SHOWCLUSTERSETTINGvar_nameALLALLCLUSTERSETTINGS
referenced by:

show_databases_stmt:

SHOWDATABASES
referenced by:

show_grants_stmt:

SHOWGRANTSopt_on_targets_rolesfor_grantee_clause
referenced by:

show_indexes_stmt:

SHOWINDEXINDEXESKEYSFROMtable_name
referenced by:

show_jobs_stmt:

SHOWopt_automaticJOBS
referenced by:

show_queries_stmt:

SHOWALLopt_clusterQUERIES
referenced by:

show_ranges_stmt:

SHOWranges_kwFROMTABLEtable_nameINDEXtable_index_name
referenced by:

show_roles_stmt:

SHOWROLES
referenced by:

show_schemas_stmt:

SHOWSCHEMASFROMname
referenced by:

show_sequences_stmt:

SHOWSEQUENCESFROMname
referenced by:

show_session_stmt:

SHOWSESSIONsession_var
referenced by:

show_sessions_stmt:

SHOWALLopt_clusterSESSIONS
referenced by:

show_stats_stmt:

SHOWSTATISTICSFORTABLEtable_name
referenced by:

show_tables_stmt:

SHOWTABLESFROMname.namewith_comment
referenced by:

show_trace_stmt:

SHOWopt_compactKVTRACEFORSESSION
referenced by:

show_users_stmt:

SHOWUSERS
referenced by:

show_zone_stmt:

SHOWZONECONFIGURATIONFORRANGEzone_nameDATABASEdatabase_nameTABLEtable_nameopt_partitionPARTITIONpartition_nameOFTABLEtable_nameINDEXtable_index_nameCONFIGURATIONSALLZONECONFIGURATIONS
referenced by:

opt_table:

TABLE
referenced by:

relation_expr_list:

relation_expr,
referenced by:

opt_drop_behavior:

CASCADERESTRICT
referenced by:

set_clause_list:

set_clause,
referenced by:

db_object_name:

simple_db_object_namecomplex_db_object_name
referenced by:

prefixed_column_path:

db_object_name_component.unrestricted_name.unrestricted_name.unrestricted_name
referenced by:

expr_list:

a_expr,
referenced by:

unreserved_keyword:

ABORTACTIONADDADMINAGGREGATEALTERATAUTOMATICBACKUPBEGINBIGSERIALBLOBBOOLBYBYTEABYTESCACHECANCELCASCADECHANGEFEEDCLUSTERCOLUMNSCOMMENTCOMMITCOMMITTEDCOMPACTCONFLICTCONFIGURATIONCONFIGURATIONSCONFIGURECONSTRAINTSCONVERSIONCOPYCOVERINGCUBECURRENTCYCLEDATADATABASEDATABASESDATEDAYDEALLOCATEDELETEDEFERREDDISCARDDOMAINDOUBLEDROPENCODINGENUMESCAPEEXECUTEEXPERIMENTALEXPERIMENTAL_AUDITEXPERIMENTAL_FINGERPRINTSEXPERIMENTAL_RANGESEXPERIMENTAL_RELOCATEEXPERIMENTAL_REPLICAEXPLAINEXPORTEXTENSIONFILESFILTERFIRSTFLOAT4FLOAT8FOLLOWINGFORCE_INDEXFUNCTIONGLOBALGRANTSGROUPSHASHHIGHHISTOGRAMHOURIMMEDIATEIMPORTINCREMENTINCREMENTALINDEXESINETINJECTINSERTINT2INT2VECTORINT4INT8INT64INTERLEAVEINVERTEDISOLATIONJOBJOBSJSONJSONBKEYKEYSKVLANGUAGELC_COLLATELC_CTYPELEASELESSLEVELLISTLOCALLOOKUPLOWMATCHMATERIALIZEDMAXVALUEMERGEMINUTEMINVALUEMONTHNAMESNANNAMENEXTNONORMALNO_INDEX_JOINOFOFFOIDOIDSOIDVECTOROPERATOROPTOPTIONOPTIONSORDINALITYOVEROWNEDPARENTPARTIALPARTITIONPASSWORDPAUSEPHYSICALPLANPLANSPRECEDINGPREPAREPRIORITYPUBLICATIONQUERIESQUERYRANGERANGESREADRECURSIVEREFREGCLASSREGPROCREGPROCEDUREREGNAMESPACEREGTYPERELEASERENAMEREPEATABLEREPLACERESETRESTORERESTRICTRESUMEREVOKEROLEROLESROLLBACKROLLUPROWSRULESETTINGSETTINGSSTATUSSAVEPOINTSCATTERSCHEMASCHEMASSCRUBSEARCHSECONDSERIALSERIALIZABLESERIAL2SERIAL4SERIAL8SERVERSEQUENCESEQUENCESSESSIONSESSIONSSETSHOWSIMPLESMALLSERIALSNAPSHOTSQLSTARTSTATISTICSSTDINSTORESTOREDSTORINGSTRICTSTRINGSPLITSUBSCRIPTIONSYNTAXSYSTEMTABLESTEMPTEMPLATETEMPORARYTESTING_RANGESTESTING_RELOCATETEXTTRACETRANSACTIONTRIGGERTRUNCATETRUSTEDTYPETHROTTLINGUNBOUNDEDUNCOMMITTEDUNKNOWNUNLOGGEDUPDATEUPSERTUUIDUSEUSERSVALIDVALIDATEVALUEVARYINGVIEWWITHINWITHOUTWRITEYEARZONE
referenced by:

col_name_keyword:

ANNOTATE_TYPEBETWEENBIGINTBITBOOLEANCHARCHARACTERCHARACTERISTICSCOALESCEDECDECIMALEXISTSEXTRACTEXTRACT_DURATIONFLOATGREATESTGROUPINGIFIFERRORIFNULLINTINTEGERINTERVALISERRORLEASTNULLIFNUMERICOUTOVERLAYPOSITIONPRECISIONREALROWSMALLINTSUBSTRINGTIMETIMETZTIMESTAMPTIMESTAMPTZTREATTRIMVALUESVARBITVARCHARVIRTUALWORK
referenced by:

non_reserved_word_or_sconst:

non_reserved_wordSCONST
referenced by:

kv_option_list:

kv_option,
referenced by:

complex_table_pattern:

complex_db_object_namedb_object_name_component.unrestricted_name.*
referenced by:

table_pattern:

simple_db_object_namecomplex_table_pattern
referenced by:

table_pattern_list:

table_pattern,
referenced by:

privilege:

nameCREATEGRANTSELECT
referenced by:

type_list:

typename,
referenced by:

transaction_mode_list:

transaction_modeopt_comma
referenced by:

opt_transaction:

TRANSACTION
referenced by:

begin_transaction:

transaction_mode_list
referenced by:

opt_to_savepoint:

TRANSACTIONTOsavepoint_name
referenced by:

opt_abort_mod:

TRANSACTIONWORK
referenced by:

alter_table_stmt:

alter_onetable_stmtalter_split_stmtalter_scatter_stmtalter_zone_table_stmtalter_rename_table_stmt
referenced by:

alter_index_stmt:

alter_oneindex_stmtalter_split_index_stmtalter_scatter_index_stmtalter_rename_index_stmtalter_zone_index_stmt
referenced by:

alter_view_stmt:

alter_rename_view_stmt
referenced by:

alter_sequence_stmt:

alter_rename_sequence_stmtalter_sequence_options_stmt
referenced by:

alter_database_stmt:

alter_rename_database_stmtalter_zone_database_stmt
referenced by:

alter_range_stmt:

alter_zone_range_stmt
referenced by:

alter_user_password_stmt:

ALTERUSERIFEXISTSstring_or_placeholderWITHPASSWORDstring_or_placeholder
referenced by:

opt_password:

opt_withPASSWORDstring_or_placeholder
referenced by:

create_changefeed_stmt:

CREATECHANGEFEEDFORchangefeed_targetsopt_changefeed_sinkopt_with_options
referenced by:

create_database_stmt:

CREATEDATABASEIFNOTEXISTSdatabase_nameopt_withopt_template_clauseopt_encoding_clauseopt_lc_collate_clauseopt_lc_ctype_clause
referenced by:

create_index_stmt:

CREATEopt_uniqueINDEXopt_index_nameIFNOTEXISTSindex_nameONtable_nameopt_using_gin_btreeINVERTEDINDEXopt_index_nameIFNOTEXISTSindex_nameONtable_name(index_params)opt_storingopt_interleaveopt_partition_by
referenced by:

create_table_stmt:

CREATETABLEIFNOTEXISTStable_name(opt_table_elem_list)opt_interleaveopt_partition_by
referenced by:

create_table_as_stmt:

CREATETABLEIFNOTEXISTStable_nameopt_column_listASselect_stmt
referenced by:

create_view_stmt:

CREATEVIEWview_nameopt_column_listASselect_stmt
referenced by:

create_sequence_stmt:

CREATESEQUENCEIFNOTEXISTSsequence_nameopt_sequence_option_list
referenced by:

statistics_name:

name
referenced by:

opt_stats_columns:

ONname_list
referenced by:

create_stats_target:

table_name
referenced by:

opt_create_stats_options:

as_of_clause
referenced by:

with_clause:

WITHcte_list
referenced by:

table_name_expr_with_index:

table_nameopt_index_flags
referenced by:

where_clause:

WHEREa_expr
referenced by:

sort_clause:

ORDERBYsortby_list
referenced by:

limit_clause:

LIMITselect_limit_valueFETCHfirst_or_nextopt_select_fetch_first_valuerow_or_rowsONLY
referenced by:

target_list:

target_elem,
referenced by:

drop_database_stmt:

DROPDATABASEIFEXISTSdatabase_nameopt_drop_behavior
referenced by:

drop_index_stmt:

DROPINDEXIFEXISTStable_index_name_listopt_drop_behavior
referenced by:

drop_table_stmt:

DROPTABLEIFEXISTStable_name_listopt_drop_behavior
referenced by:

drop_view_stmt:

DROPVIEWIFEXISTStable_name_listopt_drop_behavior
referenced by:

drop_sequence_stmt:

DROPSEQUENCEIFEXISTStable_name_listopt_drop_behavior
referenced by:

explain_option_name:

non_reserved_word
referenced by:

table_elem:

column_defindex_deffamily_deftable_constraint
referenced by:

insert_column_list:

insert_column_item,
referenced by:

opt_conf_expr:

(name_list)
referenced by:

c_expr:

d_exprarray_subscriptscase_exprEXISTSselect_with_parens
referenced by:

cast_target:

typename
referenced by:

typename:

simple_typenameopt_array_boundsARRAYpostgres_oid
referenced by:

collation_name:

unrestricted_name
referenced by:

opt_asymmetric:

ASYMMETRIC
referenced by:

b_expr:

c_expr+-~b_exprTYPECASTcast_targetTYPEANNOTATEtypename+-*/FLOORDIV%^#&|<>=CONCATLSHIFTRSHIFTLESS_EQUALSGREATER_EQUALSNOT_EQUALSb_exprISNOTDISTINCTFROMb_exprOF(type_list)
referenced by:

in_expr:

select_with_parensexpr_tuple1_ambiguous
referenced by:

subquery_op:

math_opNOTLIKEILIKE
referenced by:

sub_type:

ANYSOMEALL
referenced by:

session_var:

identifierALLDATABASENAMESSESSION_USERTIMEZONE
referenced by:

var_name:

nameattrs
referenced by:

opt_scrub_options_clause:

WITHOPTIONSscrub_option_list
referenced by:

simple_select:

simple_select_clausevalues_clausetable_clauseset_operation
referenced by:

select_clause:

simple_selectselect_with_parens
referenced by:

select_limit:

limit_clauseoffset_clauseoffset_clauselimit_clause
referenced by:

set_rest_more:

generic_set
referenced by:

to_or_eq:

=TO
referenced by:

var_value:

a_exprextra_var_value
referenced by:

opt_on_targets_roles:

ONtargets_roles
referenced by:

for_grantee_clause:

FORname_list
referenced by:

opt_automatic:

AUTOMATIC
referenced by:

opt_cluster:

CLUSTERLOCAL
referenced by:

ranges_kw:

TESTING_RANGESEXPERIMENTAL_RANGES
referenced by:

table_index_name:

table_name@index_namestandalone_index_name
referenced by:

with_comment:

WITHCOMMENT
referenced by:

opt_compact:

COMPACT
referenced by:

zone_name:

unrestricted_name
referenced by:

opt_partition:

partition
referenced by:

partition_name:

unrestricted_name
referenced by:

relation_expr:

table_name*ONLYtable_name(table_name)
referenced by:

set_clause:

single_set_clausemultiple_set_clause
referenced by:

simple_db_object_name:

db_object_name_component
referenced by:

complex_db_object_name:

db_object_name_component.unrestricted_name.unrestricted_name
referenced by:

db_object_name_component:

nameFAMILYcockroachdb_extra_reserved_keyword
referenced by:

unrestricted_name:

identifierunreserved_keywordcol_name_keywordtype_func_name_keywordreserved_keyword
referenced by:

non_reserved_word:

identifierunreserved_keywordcol_name_keywordtype_func_name_keyword
referenced by:

kv_option:

nameSCONST=string_or_placeholder
referenced by:

transaction_mode:

transaction_user_prioritytransaction_read_modeas_of_clause
referenced by:

opt_comma:

,
referenced by:

alter_onetable_stmt:

ALTERTABLEIFEXISTSrelation_expralter_table_cmds
referenced by:

alter_split_stmt:

ALTERTABLEtable_nameSPLITATselect_stmt
referenced by:

alter_scatter_stmt:

ALTERTABLEtable_nameSCATTERFROM(expr_list)TO(expr_list)
referenced by:

alter_zone_table_stmt:

ALTERPARTITIONpartition_nameOFTABLEtable_nameset_zone_config
referenced by:

alter_rename_table_stmt:

ALTERTABLEIFEXISTSrelation_exprRENAMETOtable_name
referenced by:

alter_oneindex_stmt:

ALTERINDEXIFEXISTStable_index_namealter_index_cmds
referenced by:

alter_split_index_stmt:

ALTERINDEXtable_index_nameSPLITATselect_stmt
referenced by:

alter_scatter_index_stmt:

ALTERINDEXtable_index_nameSCATTERFROM(expr_list)TO(expr_list)
referenced by:

alter_rename_index_stmt:

ALTERINDEXIFEXISTStable_index_nameRENAMETOindex_name
referenced by:

alter_zone_index_stmt:

ALTERINDEXtable_index_nameset_zone_config
referenced by:

alter_rename_view_stmt:

ALTERVIEWIFEXISTSrelation_exprRENAMETOview_name
referenced by:

alter_rename_sequence_stmt:

ALTERSEQUENCEIFEXISTSrelation_exprRENAMETOsequence_name
referenced by:

alter_sequence_options_stmt:

ALTERSEQUENCEIFEXISTSsequence_namesequence_option_list
referenced by:

alter_rename_database_stmt:

ALTERDATABASEdatabase_nameRENAMETOdatabase_name
referenced by:

alter_zone_database_stmt:

ALTERDATABASEdatabase_nameset_zone_config
referenced by:

alter_zone_range_stmt:

ALTERRANGEzone_nameset_zone_config
referenced by:

opt_with:

WITH
referenced by:

changefeed_targets:

TABLEsingle_table_pattern_list
referenced by:

opt_changefeed_sink:

INTOstring_or_placeholder
referenced by:

opt_template_clause:

TEMPLATEopt_equalnon_reserved_word_or_sconst
referenced by:

opt_encoding_clause:

ENCODINGopt_equalnon_reserved_word_or_sconst
referenced by:

opt_lc_collate_clause:

LC_COLLATEopt_equalnon_reserved_word_or_sconst
referenced by:

opt_lc_ctype_clause:

LC_CTYPEopt_equalnon_reserved_word_or_sconst
referenced by:

opt_unique:

UNIQUE
referenced by:

opt_index_name:

opt_name
referenced by:

opt_using_gin_btree:

USINGname
referenced by:

index_params:

index_elem,
referenced by:

opt_storing:

storing(name_list)
referenced by:

opt_interleave:

INTERLEAVEINPARENTtable_name(name_list)
referenced by:

opt_partition_by:

partition_by
referenced by:

index_name:

unrestricted_name
referenced by:

opt_table_elem_list:

table_elem_list
referenced by:

view_name:

table_name
referenced by:

sequence_name:

db_object_name
referenced by:

opt_sequence_option_list:

sequence_option_list
referenced by:

cte_list:

common_table_expr,
referenced by:

opt_index_flags:

@index_name[ICONST]{index_flags_param_list}
referenced by:

sortby_list:

sortby,
referenced by:

select_limit_value:

a_exprALL
referenced by:

first_or_next:

FIRSTNEXT
referenced by:

opt_select_fetch_first_value:

signed_iconst(a_expr)
referenced by:

row_or_rows:

ROWROWS
referenced by:

target_elem:

a_exprAStarget_nameidentifier*
referenced by:

table_index_name_list:

table_index_name,
referenced by:

table_name_list:

table_name,
referenced by:

column_def:

column_nametypenamecol_qual_list
referenced by:

index_def:

UNIQUEINDEXopt_index_name(index_params)opt_storingopt_interleaveopt_partition_byINVERTEDINDEXopt_name(index_params)
referenced by:

family_def:

FAMILYopt_family_name(name_list)
referenced by:

table_constraint:

CONSTRAINTconstraint_nameconstraint_elem
referenced by:

insert_column_item:

column_name
referenced by:

d_expr:

@ICONSTFCONSTconst_typenameSCONSTBCONSTBITCONSTintervalTRUEFALSENULLcolumn_path_with_starPLACEHOLDER(a_expr).*unrestricted_namefunc_exprselect_with_parenslabeled_rowARRAYselect_with_parensrowarray_expr
referenced by:

array_subscripts:

array_subscript
referenced by:

case_expr:

CASEcase_argwhen_clause_listcase_defaultEND
referenced by:

simple_typename:

const_typenamebit_with_lengthcharacter_with_lengthINTERVAL
referenced by:

opt_array_bounds:

[]
referenced by:

postgres_oid:

REGPROCREGPROCEDUREREGCLASSREGTYPEREGNAMESPACE
referenced by:

expr_tuple1_ambiguous:

(tuple1_ambiguous_values)
referenced by:

math_op:

+-*/FLOORDIV%&|^#<>=LESS_EQUALSGREATER_EQUALSNOT_EQUALS
referenced by:

attrs:

.unrestricted_name
referenced by:

scrub_option_list:

scrub_option,
referenced by:

simple_select_clause:

SELECTopt_all_clauseDISTINCTdistinct_on_clausetarget_listfrom_clauseopt_where_clausegroup_clausehaving_clausewindow_clause
referenced by:

values_clause:

VALUES(expr_list),
referenced by:

table_clause:

TABLEtable_ref
referenced by:

set_operation:

select_clauseUNIONINTERSECTEXCEPTall_or_distinctselect_clause
referenced by:

offset_clause:

OFFSETa_exprc_exprrow_or_rows
referenced by:

generic_set:

var_nameto_or_eqvar_list
referenced by:

extra_var_value:

ONcockroachdb_extra_reserved_keyword
referenced by:

targets_roles:

ROLEname_listtargets
referenced by:

standalone_index_name:

db_object_name
referenced by:

partition:

PARTITIONpartition_name
referenced by:

single_set_clause:

column_name=a_expr
referenced by:

multiple_set_clause:

(insert_column_list)=in_expr
referenced by:

cockroachdb_extra_reserved_keyword:

INDEXNOTHING
referenced by:

type_func_name_keyword:

COLLATIONCROSSFULLINNERILIKEISISNULLJOINLEFTLIKENATURALNOTNULLOUTEROVERLAPSRIGHTSIMILARFAMILY
referenced by:

reserved_keyword:

ALLANALYSEANALYZEANDANYARRAYASASCASYMMETRICBOTHCASECASTCHECKCOLLATECOLUMNCONSTRAINTCREATECURRENT_CATALOGCURRENT_DATECURRENT_ROLECURRENT_SCHEMACURRENT_TIMECURRENT_TIMESTAMPCURRENT_USERDEFAULTDEFERRABLEDESCDISTINCTDOELSEENDEXCEPTFALSEFETCHFORFOREIGNFROMGRANTGROUPHAVINGININITIALLYINTERSECTINTOLATERALLEADINGLIMITLOCALTIMELOCALTIMESTAMPNOTNULLOFFSETONONLYORORDERPLACINGPRIMARYREFERENCESRETURNINGSELECTSESSION_USERSOMESYMMETRICTABLETHENTOTRAILINGTRUEUNIONUNIQUEUSERUSINGVARIADICWHENWHEREWINDOWWITHcockroachdb_extra_reserved_keyword
referenced by:

transaction_user_priority:

PRIORITYuser_priority
referenced by:

transaction_read_mode:

READONLYWRITE
referenced by:

alter_table_cmds:

alter_table_cmd,
referenced by:

set_zone_config:

CONFIGUREZONEUSINGvar_set_listDISCARD
referenced by:

alter_index_cmds:

alter_index_cmd,
referenced by:

sequence_option_list:

sequence_option_elem
referenced by:

single_table_pattern_list:

table_name,
referenced by:

opt_equal:

=
referenced by:

opt_name:

name
referenced by:

index_elem:

a_expropt_asc_desc
referenced by:

storing:

COVERINGSTORING
referenced by:

partition_by:

PARTITIONBYLIST(name_list)(list_partitionsRANGE(name_list)(range_partitions)NOTHING
referenced by:

common_table_expr:

table_alias_nameopt_column_listAS(preparable_stmt)
referenced by:

index_flags_param_list:

index_flags_param,
referenced by:

sortby:

a_exprPRIMARYKEYtable_nameINDEXtable_name@index_nameopt_asc_desc
referenced by:

signed_iconst:

+-ICONST
referenced by:

target_name:

unrestricted_name
referenced by:

column_name:

name
referenced by:

col_qual_list:

col_qualification
referenced by:

opt_family_name:

opt_name
referenced by:

constraint_name:

name
referenced by:

constraint_elem:

CHECK(a_exprPRIMARYKEY(index_params)UNIQUE(index_params)opt_storingopt_interleaveopt_partition_byFOREIGNKEY(name_list)REFERENCEStable_nameopt_column_listkey_matchreference_actions
referenced by:

const_typename:

numericbit_without_lengthcharacter_without_lengthconst_datetimeconst_jsonBLOBBYTESBYTEATEXTNAMESERIALSERIAL2SMALLSERIALSERIAL4SERIAL8BIGSERIALUUIDINETOIDOIDVECTORINT2VECTORidentifier
referenced by:

interval:

INTERVALSCONSTopt_interval
referenced by:

column_path_with_star:

column_pathdb_object_name_component.unrestricted_name.unrestricted_name.*
referenced by:

func_expr:

func_applicationfilter_clauseover_clausefunc_expr_common_subexpr
referenced by:

labeled_row:

row(rowASname_list)
referenced by:

row:

ROW(opt_expr_list)expr_tuple_unambiguous
referenced by:

array_expr:

[opt_expr_listarray_expr_list]
referenced by:

array_subscript:

[a_expropt_slice_bound:opt_slice_bound]
referenced by:

case_arg:

a_expr
referenced by:

when_clause_list:

when_clause
referenced by:

case_default:

ELSEa_expr
referenced by:

bit_with_length:

BITopt_varyingVARBIT(ICONST)
referenced by:

character_with_length:

character_base(ICONST)
referenced by:

tuple1_ambiguous_values:

a_expr,expr_list
referenced by:

scrub_option:

INDEXCONSTRAINTALL(name_list)PHYSICAL
referenced by:

opt_all_clause:

ALL
referenced by:

from_clause:

FROMfrom_listopt_as_of_clause
referenced by:

group_clause:

GROUPBYexpr_list
referenced by:

having_clause:

HAVINGa_expr
referenced by:

window_clause:

WINDOWwindow_definition_list
referenced by:

distinct_on_clause:

DISTINCTON(expr_list)
referenced by:

table_ref:

relation_expropt_index_flagsselect_with_parensfunc_table[preparable_stmt]opt_ordinalityopt_alias_clausejoined_table(joined_table)opt_ordinalityalias_clause
referenced by:

all_or_distinct:

ALLDISTINCT
referenced by:

var_list:

var_value,
referenced by:

user_priority:

LOWNORMALHIGH
referenced by:

alter_table_cmd:

RENAMEopt_columnCONSTRAINTcolumn_nameTOcolumn_nameADDCOLUMNIFNOTEXISTScolumn_deftable_constraintopt_validate_behaviorALTERopt_columncolumn_namealter_column_defaultDROPNOTNULLSTOREDopt_set_dataTYPEtypenameopt_collateopt_alter_column_usingDROPopt_columnIFEXISTScolumn_nameCONSTRAINTIFEXISTSconstraint_nameopt_drop_behaviorVALIDATECONSTRAINTconstraint_nameEXPERIMENTAL_AUDITSETaudit_modepartition_by
referenced by:

var_set_list:

var_name=COPYFROMPARENTvar_value,var_name=var_valueCOPYFROMPARENT
referenced by:

alter_index_cmd:

partition_by
referenced by:

sequence_option_elem:

NOCYCLEMINVALUEMAXVALUEINCREMENTBYMINVALUEMAXVALUESTARTWITHsigned_iconst64VIRTUAL
referenced by:

opt_asc_desc:

ASCDESC
referenced by:

list_partitions:

list_partition,
referenced by:

range_partitions:

range_partition,
referenced by:

index_flags_param:

FORCE_INDEX=index_nameNO_INDEX_JOIN
referenced by:

col_qualification:

CONSTRAINTconstraint_namecol_qualification_elemCOLLATEcollation_nameFAMILYfamily_nameCREATEFAMILYfamily_nameIFNOTEXISTSFAMILYfamily_name
referenced by:

key_match:

MATCHSIMPLEFULL
referenced by:

reference_actions:

reference_on_updatereference_on_deletereference_on_deletereference_on_update
referenced by:

numeric:

INTINTEGERINT2SMALLINTINT4INT8INT64BIGINTREALFLOAT4FLOAT8FLOATopt_floatDOUBLEPRECISIONDECIMALDECNUMERICopt_numeric_modifiersBOOLEANBOOL
referenced by:

bit_without_length:

BITVARYINGVARBIT
referenced by:

character_without_length:

character_base
referenced by:

const_datetime:

DATETIMESTAMPopt_timezoneTIMESTAMPTZ
referenced by:

const_json:

JSONJSONB
referenced by:

opt_interval:

interval_qualifier
referenced by:

func_application:

func_name(ALLDISTINCTexpr_list*)
referenced by:

filter_clause:

FILTER(WHEREa_expr)
referenced by:

over_clause:

OVERwindow_specificationwindow_name
referenced by:

func_expr_common_subexpr:

CURRENT_DATECURRENT_SCHEMACURRENT_CATALOGCURRENT_TIMESTAMPCURRENT_USERCURRENT_ROLESESSION_USERUSERCAST(a_exprAScast_targetANNOTATE_TYPE(a_expr,typenameIF(a_expr,NULLIFIFNULL(IFERROR(a_expr,a_expr,ISERROR(a_expr,a_exprCOALESCE(expr_list)special_function
referenced by:

opt_expr_list:

expr_list
referenced by:

expr_tuple_unambiguous:

(tuple1_unambiguous_values)
referenced by:

array_expr_list:

array_expr,
referenced by:

opt_slice_bound:

a_expr
referenced by:

when_clause:

WHENa_exprTHENa_expr
referenced by:

opt_varying:

VARYING
referenced by:

character_base:

char_aliasesVARYINGVARCHARSTRING
referenced by:

from_list:

table_ref,
referenced by:

window_definition_list:

window_definition,
referenced by:

opt_ordinality:

WITHORDINALITY
referenced by:

opt_alias_clause:

alias_clause
referenced by:

joined_table:

(joined_table)table_refCROSSopt_join_hintNATURALjoin_typeopt_join_hintJOINtable_refjoin_typeopt_join_hintJOINtable_refjoin_qual
referenced by:

alias_clause:

AStable_alias_nameopt_column_list
referenced by:

func_table:

func_expr_windowlessROWSFROM(rowsfrom_list)
referenced by:

opt_column:

COLUMN
referenced by:

alter_column_default:

SETDEFAULTa_exprDROPDEFAULT
referenced by:

opt_set_data:

SETDATA
referenced by:

opt_collate:

COLLATEcollation_name
referenced by:

opt_alter_column_using:

USINGa_expr
referenced by:

opt_validate_behavior:

NOTVALID
referenced by:

audit_mode:

READWRITEOFF
referenced by:

signed_iconst64:

signed_iconst
referenced by:

list_partition:

partitionVALUESIN(expr_list)opt_partition_by
referenced by:

range_partition:

partitionVALUESFROM(expr_list)TO(expr_list)opt_partition_by
referenced by:

col_qualification_elem:

NOTNULLUNIQUEPRIMARYKEYCHECK(a_expr)DEFAULTb_exprREFERENCEStable_nameopt_name_parenskey_matchreference_actionsAS(a_expr)STORED
referenced by:

family_name:

name
referenced by:

reference_on_update:

ONUPDATEreference_action
referenced by:

reference_on_delete:

ONDELETEreference_action
referenced by:

opt_float:

(ICONST)
referenced by:

opt_numeric_modifiers:

(ICONST,ICONST)
referenced by:

opt_timezone:

WITHWITHOUTTIMEZONE
referenced by:

interval_qualifier:

YEARTOMONTHMONTHDAYTOHOURMINUTESECONDHOURTOMINUTESECONDMINUTETOSECONDSECOND
referenced by:

func_name:

type_function_nameprefixed_column_path
referenced by:

window_specification:

(opt_existing_window_nameopt_partition_clauseopt_sort_clauseopt_frame_clause)
referenced by:

window_name:

name
referenced by:

special_function:

CURRENT_DATECURRENT_SCHEMACURRENT_TIMESTAMPCURRENT_USER(EXTRACTEXTRACT_DURATION(extract_listOVERLAY(overlay_listPOSITION(position_listSUBSTRING(substr_listGREATESTLEAST(expr_listTRIM(BOTHLEADINGTRAILINGtrim_list)
referenced by:

tuple1_unambiguous_values:

a_expr,expr_list
referenced by:

char_aliases:

CHARCHARACTER
referenced by:

window_definition:

window_nameASwindow_specification
referenced by:

opt_join_hint:

HASHMERGELOOKUP
referenced by:

join_type:

FULLLEFTRIGHTjoin_outerINNER
referenced by:

join_qual:

USING(name_list)ONa_expr
referenced by:

func_expr_windowless:

func_applicationfunc_expr_common_subexpr
referenced by:

rowsfrom_list:

rowsfrom_item,
referenced by:

opt_name_parens:

(name)
referenced by:

reference_action:

NOACTIONRESTRICTCASCADESETNULLDEFAULT
referenced by:

type_function_name:

identifierunreserved_keywordtype_func_name_keyword
referenced by:

opt_existing_window_name:

name
referenced by:

opt_partition_clause:

PARTITIONBYexpr_list
referenced by:

opt_frame_clause:

RANGEROWSGROUPSframe_extent
referenced by:

extract_list:

extract_argFROMa_exprexpr_list
referenced by:

overlay_list:

a_exproverlay_placingsubstr_fromsubstr_forexpr_list
referenced by:

position_list:

b_exprINb_expr
referenced by:

substr_list:

a_exprsubstr_fromsubstr_forsubstr_forsubstr_fromopt_expr_list
referenced by:

trim_list:

a_exprFROMexpr_list
referenced by:

join_outer:

OUTER
referenced by:

rowsfrom_item:

func_expr_windowless
referenced by:

frame_extent:

BETWEENframe_boundANDframe_bound
referenced by:

extract_arg:

identifierYEARMONTHDAYHOURMINUTESECOND
referenced by:

overlay_placing:

PLACINGa_expr
referenced by:

substr_from:

FROMa_expr
referenced by:

substr_for:

FORa_expr
referenced by:

frame_bound:

UNBOUNDEDa_exprPRECEDINGFOLLOWINGCURRENTROW
referenced by:

generated by Railroad Diagram Generator

Was this page helpful?
YesNo