stmt_block ::=
	stmt_list

stmt_list ::=
	( stmt ) ( ( ';' stmt ) )*

stmt ::=
	'HELPTOKEN'
	| preparable_stmt
	| copy_from_stmt
	| execute_stmt
	| deallocate_stmt
	| discard_stmt
	| export_stmt
	| grant_stmt
	| prepare_stmt
	| revoke_stmt
	| savepoint_stmt
	| release_stmt
	| nonpreparable_set_stmt
	| transaction_stmt
	| 

preparable_stmt ::=
	alter_stmt
	| backup_stmt
	| cancel_stmt
	| create_stmt
	| delete_stmt
	| drop_stmt
	| import_stmt
	| insert_stmt
	| pause_stmt
	| reset_stmt
	| restore_stmt
	| resume_stmt
	| scrub_stmt
	| select_stmt
	| preparable_set_stmt
	| show_stmt
	| truncate_stmt
	| update_stmt
	| upsert_stmt

copy_from_stmt ::=
	'COPY' table_name opt_column_list 'FROM' 'STDIN'

execute_stmt ::=
	'EXECUTE' table_alias_name execute_param_clause

deallocate_stmt ::=
	'DEALLOCATE' name
	| 'DEALLOCATE' 'PREPARE' name
	| 'DEALLOCATE' 'ALL'
	| 'DEALLOCATE' 'PREPARE' 'ALL'

discard_stmt ::=
	'DISCARD' 'ALL'

export_stmt ::=
	'EXPORT' 'INTO' import_format string_or_placeholder opt_with_options 'FROM' select_stmt

grant_stmt ::=
	'GRANT' privileges 'ON' targets 'TO' name_list
	| 'GRANT' privilege_list 'TO' name_list
	| 'GRANT' privilege_list 'TO' name_list 'WITH' 'ADMIN' 'OPTION'

prepare_stmt ::=
	'PREPARE' table_alias_name prep_type_clause 'AS' preparable_stmt

revoke_stmt ::=
	'REVOKE' privileges 'ON' targets 'FROM' name_list
	| 'REVOKE' privilege_list 'FROM' name_list
	| 'REVOKE' 'ADMIN' 'OPTION' 'FOR' privilege_list 'FROM' name_list

savepoint_stmt ::=
	'SAVEPOINT' name

release_stmt ::=
	'RELEASE' savepoint_name

nonpreparable_set_stmt ::=
	set_transaction_stmt

transaction_stmt ::=
	begin_stmt
	| commit_stmt
	| rollback_stmt
	| abort_stmt

alter_stmt ::=
	alter_ddl_stmt
	| alter_user_stmt

backup_stmt ::=
	'BACKUP' targets 'TO' string_or_placeholder opt_as_of_clause opt_incremental opt_with_options

cancel_stmt ::=
	cancel_jobs_stmt
	| cancel_queries_stmt
	| cancel_sessions_stmt

create_stmt ::=
	create_user_stmt
	| create_role_stmt
	| create_ddl_stmt

delete_stmt ::=
	opt_with_clause 'DELETE' 'FROM' table_name_expr_opt_alias_idx opt_where_clause opt_sort_clause opt_limit_clause returning_clause

drop_stmt ::=
	drop_ddl_stmt
	| drop_role_stmt
	| drop_user_stmt

import_stmt ::=
	'IMPORT' import_format string_or_placeholder opt_with_options
	| 'IMPORT' 'TABLE' table_name 'FROM' import_format string_or_placeholder opt_with_options
	| 'IMPORT' 'TABLE' table_name 'CREATE' 'USING' string_or_placeholder import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options
	| 'IMPORT' 'TABLE' table_name '(' table_elem_list ')' import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options

insert_stmt ::=
	opt_with_clause 'INSERT' 'INTO' insert_target insert_rest returning_clause
	| opt_with_clause 'INSERT' 'INTO' insert_target insert_rest on_conflict returning_clause

pause_stmt ::=
	'PAUSE' 'JOB' a_expr
	| 'PAUSE' 'JOBS' select_stmt

reset_stmt ::=
	reset_session_stmt
	| reset_csetting_stmt

restore_stmt ::=
	'RESTORE' targets 'FROM' string_or_placeholder_list opt_with_options
	| 'RESTORE' targets 'FROM' string_or_placeholder_list as_of_clause opt_with_options

resume_stmt ::=
	'RESUME' 'JOB' a_expr
	| 'RESUME' 'JOBS' select_stmt

scrub_stmt ::=
	scrub_table_stmt
	| scrub_database_stmt

select_stmt ::=
	select_no_parens
	| select_with_parens

preparable_set_stmt ::=
	set_session_stmt
	| set_csetting_stmt
	| use_stmt

show_stmt ::=
	show_backup_stmt
	| show_columns_stmt
	| show_constraints_stmt
	| show_create_stmt
	| show_csettings_stmt
	| show_databases_stmt
	| show_grants_stmt
	| show_indexes_stmt
	| show_jobs_stmt
	| show_queries_stmt
	| show_ranges_stmt
	| show_roles_stmt
	| show_schemas_stmt
	| show_session_stmt
	| show_sessions_stmt
	| show_tables_stmt
	| show_trace_stmt
	| show_users_stmt
	| show_zone_stmt

truncate_stmt ::=
	'TRUNCATE' opt_table relation_expr_list opt_drop_behavior

update_stmt ::=
	opt_with_clause 'UPDATE' table_name_expr_opt_alias_idx 'SET' set_clause_list opt_where_clause opt_sort_clause opt_limit_clause returning_clause

upsert_stmt ::=
	opt_with_clause 'UPSERT' 'INTO' insert_target insert_rest returning_clause

table_name ::=
	db_object_name

opt_column_list ::=
	'(' name_list ')'
	| 

table_alias_name ::=
	name

execute_param_clause ::=
	'(' expr_list ')'
	| 

name ::=
	'identifier'
	| unreserved_keyword
	| col_name_keyword

import_format ::=
	name

string_or_placeholder ::=
	non_reserved_word_or_sconst
	| 'PLACEHOLDER'

opt_with_options ::=
	'WITH' kv_option_list
	| 'WITH' 'OPTIONS' '(' kv_option_list ')'
	| 

privileges ::=
	'ALL'
	| privilege_list

targets ::=
	'identifier'
	| col_name_keyword
	| unreserved_keyword
	| complex_table_pattern
	| table_pattern ',' table_pattern_list
	| 'TABLE' table_pattern_list
	| 'DATABASE' name_list

name_list ::=
	( name ) ( ( ',' name ) )*

privilege_list ::=
	( privilege ) ( ( ',' privilege ) )*

prep_type_clause ::=
	'(' type_list ')'
	| 

savepoint_name ::=
	'SAVEPOINT' name
	| name

set_transaction_stmt ::=
	'SET' 'TRANSACTION' transaction_mode_list
	| 'SET' 'SESSION' 'TRANSACTION' transaction_mode_list

begin_stmt ::=
	'BEGIN' opt_transaction begin_transaction
	| 'START' 'TRANSACTION' begin_transaction

commit_stmt ::=
	'COMMIT' opt_transaction
	| 'END' opt_transaction

rollback_stmt ::=
	'ROLLBACK' opt_to_savepoint

abort_stmt ::=
	'ABORT' opt_abort_mod

alter_ddl_stmt ::=
	alter_table_stmt
	| alter_index_stmt
	| alter_view_stmt
	| alter_sequence_stmt
	| alter_database_stmt
	| alter_range_stmt

alter_user_stmt ::=
	alter_user_password_stmt

opt_as_of_clause ::=
	as_of_clause
	| 

opt_incremental ::=
	'INCREMENTAL' 'FROM' string_or_placeholder_list
	| 

cancel_jobs_stmt ::=
	'CANCEL' 'JOB' a_expr
	| 'CANCEL' 'JOBS' select_stmt

cancel_queries_stmt ::=
	'CANCEL' 'QUERY' a_expr
	| 'CANCEL' 'QUERY' 'IF' 'EXISTS' a_expr
	| 'CANCEL' 'QUERIES' select_stmt
	| 'CANCEL' 'QUERIES' 'IF' 'EXISTS' select_stmt

cancel_sessions_stmt ::=
	'CANCEL' 'SESSION' a_expr
	| 'CANCEL' 'SESSION' 'IF' 'EXISTS' a_expr
	| 'CANCEL' 'SESSIONS' select_stmt
	| 'CANCEL' 'SESSIONS' 'IF' 'EXISTS' select_stmt

create_user_stmt ::=
	'CREATE' 'USER' string_or_placeholder opt_password
	| 'CREATE' 'USER' 'IF' 'NOT' 'EXISTS' string_or_placeholder opt_password

create_role_stmt ::=
	'CREATE' role_or_group string_or_placeholder
	| 'CREATE' role_or_group 'IF' 'NOT' 'EXISTS' string_or_placeholder

create_ddl_stmt ::=
	create_changefeed_stmt
	| create_database_stmt
	| create_index_stmt
	| create_table_stmt
	| create_table_as_stmt
	| create_view_stmt
	| create_sequence_stmt

opt_with_clause ::=
	with_clause
	| 

table_name_expr_opt_alias_idx ::=
	table_name_expr_with_index
	| table_name_expr_with_index table_alias_name
	| table_name_expr_with_index 'AS' table_alias_name

opt_where_clause ::=
	where_clause
	| 

opt_sort_clause ::=
	sort_clause
	| 

opt_limit_clause ::=
	limit_clause
	| 

returning_clause ::=
	'RETURNING' target_list
	| 'RETURNING' 'NOTHING'
	| 

drop_ddl_stmt ::=
	drop_database_stmt
	| drop_index_stmt
	| drop_table_stmt
	| drop_view_stmt
	| drop_sequence_stmt

drop_role_stmt ::=
	'DROP' 'ROLE' string_or_placeholder_list
	| 'DROP' 'ROLE' 'IF' 'EXISTS' string_or_placeholder_list

drop_user_stmt ::=
	'DROP' 'USER' string_or_placeholder_list
	| 'DROP' 'USER' 'IF' 'EXISTS' string_or_placeholder_list

string_or_placeholder_list ::=
	( string_or_placeholder ) ( ( ',' string_or_placeholder ) )*

table_elem_list ::=
	( table_elem ) ( ( ',' table_elem ) )*

insert_target ::=
	table_name
	| table_name 'AS' table_alias_name

insert_rest ::=
	select_stmt
	| '(' insert_column_list ')' select_stmt
	| 'DEFAULT' 'VALUES'

on_conflict ::=
	'ON' 'CONFLICT' opt_conf_expr 'DO' 'UPDATE' 'SET' set_clause_list opt_where_clause
	| 'ON' 'CONFLICT' opt_conf_expr 'DO' 'NOTHING'

a_expr ::=
	( c_expr | '+' a_expr | '-' a_expr | '~' a_expr | 'NOT' a_expr | 'NOT' a_expr | 'DEFAULT' | 'MAXVALUE' | 'MINVALUE' ) ( ( 'TYPECAST' cast_target | 'TYPEANNOTATE' typename | 'COLLATE' collation_name | '+' a_expr | '-' a_expr | '*' a_expr | '/' a_expr | 'FLOORDIV' a_expr | '%' a_expr | '^' a_expr | '#' a_expr | '&' a_expr | '|' a_expr | '<' a_expr | '>' a_expr | '?' a_expr | 'JSON_SOME_EXISTS' a_expr | 'JSON_ALL_EXISTS' a_expr | 'CONTAINS' a_expr | 'CONTAINED_BY' a_expr | '=' a_expr | 'CONCAT' a_expr | 'LSHIFT' a_expr | 'RSHIFT' a_expr | 'FETCHVAL' a_expr | 'FETCHTEXT' a_expr | 'FETCHVAL_PATH' a_expr | 'FETCHTEXT_PATH' a_expr | 'REMOVE_PATH' a_expr | 'INET_CONTAINED_BY_OR_EQUALS' a_expr | 'INET_CONTAINS_OR_CONTAINED_BY' a_expr | 'INET_CONTAINS_OR_EQUALS' a_expr | 'LESS_EQUALS' a_expr | 'GREATER_EQUALS' a_expr | 'NOT_EQUALS' a_expr | 'AND' a_expr | 'OR' a_expr | 'LIKE' a_expr | 'LIKE' a_expr 'ESCAPE' a_expr | 'NOT' 'LIKE' a_expr | 'NOT' 'LIKE' a_expr 'ESCAPE' a_expr | 'ILIKE' a_expr | 'ILIKE' a_expr 'ESCAPE' a_expr | 'NOT' 'ILIKE' a_expr | 'NOT' 'ILIKE' a_expr 'ESCAPE' a_expr | 'SIMILAR' 'TO' a_expr | 'SIMILAR' 'TO' a_expr 'ESCAPE' a_expr | 'NOT' 'SIMILAR' 'TO' a_expr | 'NOT' 'SIMILAR' 'TO' a_expr 'ESCAPE' a_expr | '~' a_expr | 'NOT_REGMATCH' a_expr | 'REGIMATCH' a_expr | 'NOT_REGIMATCH' a_expr | 'IS' 'NAN' | 'IS' 'NOT' 'NAN' | 'IS' 'NULL' | 'ISNULL' | 'IS' 'NOT' 'NULL' | 'NOTNULL' | 'IS' 'TRUE' | 'IS' 'NOT' 'TRUE' | 'IS' 'FALSE' | 'IS' 'NOT' 'FALSE' | 'IS' 'UNKNOWN' | 'IS' 'NOT' 'UNKNOWN' | 'IS' 'DISTINCT' 'FROM' a_expr | 'IS' 'NOT' 'DISTINCT' 'FROM' a_expr | 'IS' 'OF' '(' type_list ')' | 'IS' 'NOT' 'OF' '(' type_list ')' | 'BETWEEN' opt_asymmetric b_expr 'AND' a_expr | 'NOT' 'BETWEEN' opt_asymmetric b_expr 'AND' a_expr | 'BETWEEN' 'SYMMETRIC' b_expr 'AND' a_expr | 'NOT' 'BETWEEN' 'SYMMETRIC' b_expr 'AND' a_expr | 'IN' in_expr | 'NOT' 'IN' in_expr | subquery_op sub_type a_expr ) )*

reset_session_stmt ::=
	'RESET' session_var
	| 'RESET' 'SESSION' session_var

reset_csetting_stmt ::=
	'RESET' 'CLUSTER' 'SETTING' var_name

as_of_clause ::=
	'AS' 'OF' 'SYSTEM' 'TIME' a_expr

scrub_table_stmt ::=
	'EXPERIMENTAL' 'SCRUB' 'TABLE' table_name opt_as_of_clause opt_scrub_options_clause

scrub_database_stmt ::=
	'EXPERIMENTAL' 'SCRUB' 'DATABASE' database_name opt_as_of_clause

select_no_parens ::=
	simple_select
	| select_clause sort_clause
	| select_clause opt_sort_clause select_limit
	| with_clause select_clause
	| with_clause select_clause sort_clause
	| with_clause select_clause opt_sort_clause select_limit

select_with_parens ::=
	'(' select_no_parens ')'
	| '(' select_with_parens ')'

set_session_stmt ::=
	'SET' 'SESSION' set_rest_more
	| 'SET' set_rest_more
	| 'SET' 'SESSION' 'CHARACTERISTICS' 'AS' 'TRANSACTION' transaction_mode_list

set_csetting_stmt ::=
	'SET' 'CLUSTER' 'SETTING' var_name to_or_eq var_value

use_stmt ::=
	'USE' var_value

show_backup_stmt ::=
	'SHOW' 'BACKUP' string_or_placeholder

show_columns_stmt ::=
	'SHOW' 'COLUMNS' 'FROM' table_name

show_constraints_stmt ::=
	'SHOW' 'CONSTRAINT' 'FROM' table_name
	| 'SHOW' 'CONSTRAINTS' 'FROM' table_name

show_create_stmt ::=
	'SHOW' 'CREATE' table_name

show_csettings_stmt ::=
	'SHOW' 'CLUSTER' 'SETTING' var_name
	| 'SHOW' 'CLUSTER' 'SETTING' 'ALL'
	| 'SHOW' 'ALL' 'CLUSTER' 'SETTINGS'

show_databases_stmt ::=
	'SHOW' 'DATABASES'

show_grants_stmt ::=
	'SHOW' 'GRANTS' opt_on_targets_roles for_grantee_clause

show_indexes_stmt ::=
	'SHOW' 'INDEX' 'FROM' table_name
	| 'SHOW' 'INDEXES' 'FROM' table_name
	| 'SHOW' 'KEYS' 'FROM' table_name

show_jobs_stmt ::=
	'SHOW' 'JOBS'

show_queries_stmt ::=
	'SHOW' 'QUERIES'
	| 'SHOW' 'CLUSTER' 'QUERIES'
	| 'SHOW' 'LOCAL' 'QUERIES'

show_ranges_stmt ::=
	'SHOW' ranges_kw 'FROM' 'TABLE' table_name
	| 'SHOW' ranges_kw 'FROM' 'INDEX' table_name_with_index

show_roles_stmt ::=
	'SHOW' 'ROLES'

show_schemas_stmt ::=
	'SHOW' 'SCHEMAS' 'FROM' name
	| 'SHOW' 'SCHEMAS'

show_session_stmt ::=
	'SHOW' session_var
	| 'SHOW' 'SESSION' session_var

show_sessions_stmt ::=
	'SHOW' 'SESSIONS'
	| 'SHOW' 'CLUSTER' 'SESSIONS'
	| 'SHOW' 'LOCAL' 'SESSIONS'

show_tables_stmt ::=
	'SHOW' 'TABLES' 'FROM' name '.' name
	| 'SHOW' 'TABLES' 'FROM' name
	| 'SHOW' 'TABLES'

show_trace_stmt ::=
	'SHOW' opt_compact 'TRACE' 'FOR' 'SESSION'
	| 'SHOW' opt_compact 'KV' 'TRACE' 'FOR' 'SESSION'

show_users_stmt ::=
	'SHOW' 'USERS'

show_zone_stmt ::=
	'SHOW' 'ZONE' 'CONFIGURATION' 'FOR' 'RANGE' zone_name
	| 'SHOW' 'ZONE' 'CONFIGURATION' 'FOR' 'DATABASE' database_name
	| 'SHOW' 'ZONE' 'CONFIGURATION' 'FOR' 'TABLE' table_name opt_partition
	| 'SHOW' 'ZONE' 'CONFIGURATION' 'FOR' 'PARTITION' partition_name 'OF' 'TABLE' table_name
	| 'SHOW' 'ZONE' 'CONFIGURATION' 'FOR' 'INDEX' table_name_with_index
	| 'SHOW' 'ZONE' 'CONFIGURATIONS'
	| 'SHOW' 'ALL' 'ZONE' 'CONFIGURATIONS'

opt_table ::=
	'TABLE'
	| 

relation_expr_list ::=
	( relation_expr ) ( ( ',' relation_expr ) )*

opt_drop_behavior ::=
	'CASCADE'
	| 'RESTRICT'
	| 

set_clause_list ::=
	( set_clause ) ( ( ',' set_clause ) )*

db_object_name ::=
	simple_db_object_name
	| complex_db_object_name

expr_list ::=
	( a_expr ) ( ( ',' a_expr ) )*

unreserved_keyword ::=
	'ABORT'
	| 'ACTION'
	| 'ADD'
	| 'ADMIN'
	| 'AGGREGATE'
	| 'ALTER'
	| 'AT'
	| 'BACKUP'
	| 'BEGIN'
	| 'BIGSERIAL'
	| 'BLOB'
	| 'BOOL'
	| 'BY'
	| 'BYTEA'
	| 'BYTES'
	| 'CACHE'
	| 'CANCEL'
	| 'CASCADE'
	| 'CHANGEFEED'
	| 'CLUSTER'
	| 'COLUMNS'
	| 'COMMENT'
	| 'COMMIT'
	| 'COMMITTED'
	| 'COMPACT'
	| 'CONFLICT'
	| 'CONFIGURATION'
	| 'CONFIGURATIONS'
	| 'CONFIGURE'
	| 'CONSTRAINTS'
	| 'CONVERSION'
	| 'COPY'
	| 'COVERING'
	| 'CUBE'
	| 'CURRENT'
	| 'CYCLE'
	| 'DATA'
	| 'DATABASE'
	| 'DATABASES'
	| 'DATE'
	| 'DAY'
	| 'DEALLOCATE'
	| 'DELETE'
	| 'DEFERRED'
	| 'DISCARD'
	| 'DOMAIN'
	| 'DOUBLE'
	| 'DROP'
	| 'ENCODING'
	| 'ENUM'
	| 'ESCAPE'
	| 'EXECUTE'
	| 'EXPERIMENTAL'
	| 'EXPERIMENTAL_AUDIT'
	| 'EXPERIMENTAL_FINGERPRINTS'
	| 'EXPERIMENTAL_RANGES'
	| 'EXPERIMENTAL_RELOCATE'
	| 'EXPERIMENTAL_REPLICA'
	| 'EXPLAIN'
	| 'EXPORT'
	| 'EXTENSION'
	| 'FILES'
	| 'FILTER'
	| 'FIRST'
	| 'FLOAT4'
	| 'FLOAT8'
	| 'FOLLOWING'
	| 'FORCE_INDEX'
	| 'FUNCTION'
	| 'GLOBAL'
	| 'GRANTS'
	| 'GROUPS'
	| 'HIGH'
	| 'HISTOGRAM'
	| 'HOUR'
	| 'IMMEDIATE'
	| 'IMPORT'
	| 'INCREMENT'
	| 'INCREMENTAL'
	| 'INDEXES'
	| 'INET'
	| 'INJECT'
	| 'INSERT'
	| 'INT2'
	| 'INT2VECTOR'
	| 'INT4'
	| 'INT8'
	| 'INT64'
	| 'INTERLEAVE'
	| 'INVERTED'
	| 'ISOLATION'
	| 'JOB'
	| 'JOBS'
	| 'JSON'
	| 'JSONB'
	| 'KEY'
	| 'KEYS'
	| 'KV'
	| 'LANGUAGE'
	| 'LC_COLLATE'
	| 'LC_CTYPE'
	| 'LEASE'
	| 'LESS'
	| 'LEVEL'
	| 'LIST'
	| 'LOCAL'
	| 'LOW'
	| 'MATCH'
	| 'MATERIALIZED'
	| 'MINUTE'
	| 'MONTH'
	| 'NAMES'
	| 'NAN'
	| 'NAME'
	| 'NEXT'
	| 'NO'
	| 'NORMAL'
	| 'NO_INDEX_JOIN'
	| 'OF'
	| 'OFF'
	| 'OID'
	| 'OIDS'
	| 'OIDVECTOR'
	| 'OPERATOR'
	| 'OPTION'
	| 'OPTIONS'
	| 'ORDINALITY'
	| 'OVER'
	| 'OWNED'
	| 'PARENT'
	| 'PARTIAL'
	| 'PARTITION'
	| 'PASSWORD'
	| 'PAUSE'
	| 'PHYSICAL'
	| 'PLANS'
	| 'PRECEDING'
	| 'PREPARE'
	| 'PRIORITY'
	| 'PUBLICATION'
	| 'QUERIES'
	| 'QUERY'
	| 'RANGE'
	| 'RANGES'
	| 'READ'
	| 'RECURSIVE'
	| 'REF'
	| 'REGCLASS'
	| 'REGPROC'
	| 'REGPROCEDURE'
	| 'REGNAMESPACE'
	| 'REGTYPE'
	| 'RELEASE'
	| 'RENAME'
	| 'REPEATABLE'
	| 'REPLACE'
	| 'RESET'
	| 'RESTORE'
	| 'RESTRICT'
	| 'RESUME'
	| 'REVOKE'
	| 'ROLE'
	| 'ROLES'
	| 'ROLLBACK'
	| 'ROLLUP'
	| 'ROWS'
	| 'RULE'
	| 'SETTING'
	| 'SETTINGS'
	| 'STATUS'
	| 'SAVEPOINT'
	| 'SCATTER'
	| 'SCHEMA'
	| 'SCHEMAS'
	| 'SCRUB'
	| 'SEARCH'
	| 'SECOND'
	| 'SERIAL'
	| 'SERIALIZABLE'
	| 'SERIAL2'
	| 'SERIAL4'
	| 'SERIAL8'
	| 'SERVER'
	| 'SEQUENCE'
	| 'SEQUENCES'
	| 'SESSION'
	| 'SESSIONS'
	| 'SET'
	| 'SHOW'
	| 'SIMPLE'
	| 'SMALLSERIAL'
	| 'SNAPSHOT'
	| 'SQL'
	| 'START'
	| 'STATISTICS'
	| 'STDIN'
	| 'STORE'
	| 'STORED'
	| 'STORING'
	| 'STRICT'
	| 'STRING'
	| 'SPLIT'
	| 'SUBSCRIPTION'
	| 'SYNTAX'
	| 'SYSTEM'
	| 'TABLES'
	| 'TEMP'
	| 'TEMPLATE'
	| 'TEMPORARY'
	| 'TESTING_RANGES'
	| 'TESTING_RELOCATE'
	| 'TEXT'
	| 'TRACE'
	| 'TRANSACTION'
	| 'TRIGGER'
	| 'TRUNCATE'
	| 'TRUSTED'
	| 'TYPE'
	| 'UNBOUNDED'
	| 'UNCOMMITTED'
	| 'UNKNOWN'
	| 'UNLOGGED'
	| 'UPDATE'
	| 'UPSERT'
	| 'UUID'
	| 'USE'
	| 'USERS'
	| 'VALID'
	| 'VALIDATE'
	| 'VALUE'
	| 'VARYING'
	| 'VIEW'
	| 'WITHIN'
	| 'WITHOUT'
	| 'WRITE'
	| 'YEAR'
	| 'ZONE'

col_name_keyword ::=
	'ANNOTATE_TYPE'
	| 'BETWEEN'
	| 'BIGINT'
	| 'BIT'
	| 'BOOLEAN'
	| 'CHAR'
	| 'CHARACTER'
	| 'CHARACTERISTICS'
	| 'COALESCE'
	| 'DEC'
	| 'DECIMAL'
	| 'EXISTS'
	| 'EXTRACT'
	| 'EXTRACT_DURATION'
	| 'FLOAT'
	| 'GREATEST'
	| 'GROUPING'
	| 'IF'
	| 'IFERROR'
	| 'IFNULL'
	| 'INT'
	| 'INTEGER'
	| 'INTERVAL'
	| 'ISERROR'
	| 'LEAST'
	| 'NULLIF'
	| 'NUMERIC'
	| 'OUT'
	| 'OVERLAY'
	| 'POSITION'
	| 'PRECISION'
	| 'REAL'
	| 'ROW'
	| 'SMALLINT'
	| 'SUBSTRING'
	| 'TIME'
	| 'TIMETZ'
	| 'TIMESTAMP'
	| 'TIMESTAMPTZ'
	| 'TREAT'
	| 'TRIM'
	| 'VALUES'
	| 'VARCHAR'
	| 'VIRTUAL'
	| 'WORK'

non_reserved_word_or_sconst ::=
	non_reserved_word
	| 'SCONST'

kv_option_list ::=
	( kv_option ) ( ( ',' kv_option ) )*

complex_table_pattern ::=
	complex_db_object_name
	| name '.' unrestricted_name '.' '*'
	| name '.' '*'
	| '*'

table_pattern ::=
	simple_db_object_name
	| complex_table_pattern

table_pattern_list ::=
	( table_pattern ) ( ( ',' table_pattern ) )*

privilege ::=
	name
	| 'CREATE'
	| 'GRANT'
	| 'SELECT'

type_list ::=
	( typename ) ( ( ',' typename ) )*

transaction_mode_list ::=
	( transaction_mode ) ( ( opt_comma transaction_mode ) )*

opt_transaction ::=
	'TRANSACTION'
	| 

begin_transaction ::=
	transaction_mode_list
	| 

opt_to_savepoint ::=
	'TRANSACTION'
	| 'TRANSACTION' 'TO' savepoint_name
	| 'TO' savepoint_name
	| 

opt_abort_mod ::=
	'TRANSACTION'
	| 'WORK'
	| 

alter_table_stmt ::=
	alter_onetable_stmt
	| alter_split_stmt
	| alter_scatter_stmt
	| alter_zone_table_stmt
	| alter_rename_table_stmt

alter_index_stmt ::=
	alter_oneindex_stmt
	| alter_split_index_stmt
	| alter_scatter_index_stmt
	| alter_rename_index_stmt
	| alter_zone_index_stmt

alter_view_stmt ::=
	alter_rename_view_stmt

alter_sequence_stmt ::=
	alter_rename_sequence_stmt
	| alter_sequence_options_stmt

alter_database_stmt ::=
	alter_rename_database_stmt
	| alter_zone_database_stmt

alter_range_stmt ::=
	alter_zone_range_stmt

alter_user_password_stmt ::=
	'ALTER' 'USER' string_or_placeholder 'WITH' 'PASSWORD' string_or_placeholder
	| 'ALTER' 'USER' 'IF' 'EXISTS' string_or_placeholder 'WITH' 'PASSWORD' string_or_placeholder

opt_password ::=
	opt_with 'PASSWORD' string_or_placeholder
	| 

role_or_group ::=
	'ROLE'

create_changefeed_stmt ::=
	'CREATE' 'CHANGEFEED' 'FOR' changefeed_targets opt_changefeed_sink opt_with_options

create_database_stmt ::=
	'CREATE' 'DATABASE' database_name opt_with opt_template_clause opt_encoding_clause opt_lc_collate_clause opt_lc_ctype_clause
	| 'CREATE' 'DATABASE' 'IF' 'NOT' 'EXISTS' database_name opt_with opt_template_clause opt_encoding_clause opt_lc_collate_clause opt_lc_ctype_clause

create_index_stmt ::=
	'CREATE' opt_unique 'INDEX' opt_index_name 'ON' table_name opt_using_gin_btree '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'CREATE' opt_unique 'INDEX' 'IF' 'NOT' 'EXISTS' index_name 'ON' table_name opt_using_gin_btree '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'CREATE' opt_unique 'INVERTED' 'INDEX' opt_index_name 'ON' table_name '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'CREATE' opt_unique 'INVERTED' 'INDEX' 'IF' 'NOT' 'EXISTS' index_name 'ON' table_name '(' index_params ')' opt_storing opt_interleave opt_partition_by

create_table_stmt ::=
	'CREATE' 'TABLE' table_name '(' opt_table_elem_list ')' opt_interleave opt_partition_by
	| 'CREATE' 'TABLE' 'IF' 'NOT' 'EXISTS' table_name '(' opt_table_elem_list ')' opt_interleave opt_partition_by

create_table_as_stmt ::=
	'CREATE' 'TABLE' table_name opt_column_list 'AS' select_stmt
	| 'CREATE' 'TABLE' 'IF' 'NOT' 'EXISTS' table_name opt_column_list 'AS' select_stmt

create_view_stmt ::=
	'CREATE' 'VIEW' view_name opt_column_list 'AS' select_stmt

create_sequence_stmt ::=
	'CREATE' 'SEQUENCE' sequence_name opt_sequence_option_list
	| 'CREATE' 'SEQUENCE' 'IF' 'NOT' 'EXISTS' sequence_name opt_sequence_option_list

with_clause ::=
	'WITH' cte_list

table_name_expr_with_index ::=
	table_name opt_index_flags

where_clause ::=
	'WHERE' a_expr

sort_clause ::=
	'ORDER' 'BY' sortby_list

limit_clause ::=
	'LIMIT' select_limit_value
	| 'FETCH' first_or_next opt_select_fetch_first_value row_or_rows 'ONLY'

target_list ::=
	( target_elem ) ( ( ',' target_elem ) )*

drop_database_stmt ::=
	'DROP' 'DATABASE' database_name opt_drop_behavior
	| 'DROP' 'DATABASE' 'IF' 'EXISTS' database_name opt_drop_behavior

drop_index_stmt ::=
	'DROP' 'INDEX' table_name_with_index_list opt_drop_behavior
	| 'DROP' 'INDEX' 'IF' 'EXISTS' table_name_with_index_list opt_drop_behavior

drop_table_stmt ::=
	'DROP' 'TABLE' table_name_list opt_drop_behavior
	| 'DROP' 'TABLE' 'IF' 'EXISTS' table_name_list opt_drop_behavior

drop_view_stmt ::=
	'DROP' 'VIEW' table_name_list opt_drop_behavior
	| 'DROP' 'VIEW' 'IF' 'EXISTS' table_name_list opt_drop_behavior

drop_sequence_stmt ::=
	'DROP' 'SEQUENCE' table_name_list opt_drop_behavior
	| 'DROP' 'SEQUENCE' 'IF' 'EXISTS' table_name_list opt_drop_behavior

table_elem ::=
	column_def
	| index_def
	| family_def
	| table_constraint

insert_column_list ::=
	( insert_column_item ) ( ( ',' insert_column_item ) )*

opt_conf_expr ::=
	'(' name_list ')'
	| 

c_expr ::=
	d_expr
	| d_expr array_subscripts
	| case_expr
	| 'EXISTS' select_with_parens

cast_target ::=
	typename

typename ::=
	simple_typename opt_array_bounds
	| simple_typename 'ARRAY'
	| postgres_oid

collation_name ::=
	unrestricted_name

opt_asymmetric ::=
	'ASYMMETRIC'
	| 

b_expr ::=
	( c_expr | '+' b_expr | '-' b_expr | '~' b_expr ) ( ( 'TYPECAST' cast_target | 'TYPEANNOTATE' typename | '+' b_expr | '-' b_expr | '*' b_expr | '/' b_expr | 'FLOORDIV' b_expr | '%' b_expr | '^' b_expr | '#' b_expr | '&' b_expr | '|' b_expr | '<' b_expr | '>' b_expr | '=' b_expr | 'CONCAT' b_expr | 'LSHIFT' b_expr | 'RSHIFT' b_expr | 'LESS_EQUALS' b_expr | 'GREATER_EQUALS' b_expr | 'NOT_EQUALS' b_expr | 'IS' 'DISTINCT' 'FROM' b_expr | 'IS' 'NOT' 'DISTINCT' 'FROM' b_expr | 'IS' 'OF' '(' type_list ')' | 'IS' 'NOT' 'OF' '(' type_list ')' ) )*

in_expr ::=
	select_with_parens
	| expr_tuple1_ambiguous

subquery_op ::=
	math_op
	| 'LIKE'
	| 'NOT' 'LIKE'
	| 'ILIKE'
	| 'NOT' 'ILIKE'

sub_type ::=
	'ANY'
	| 'SOME'
	| 'ALL'

session_var ::=
	'identifier'
	| 'ALL'
	| 'DATABASE'
	| 'NAMES'
	| 'SESSION_USER'
	| 'TIME' 'ZONE'

var_name ::=
	name
	| name attrs

opt_scrub_options_clause ::=
	'WITH' 'OPTIONS' scrub_option_list
	| 

database_name ::=
	name

simple_select ::=
	simple_select_clause
	| values_clause
	| table_clause
	| set_operation

select_clause ::=
	simple_select
	| select_with_parens

select_limit ::=
	limit_clause offset_clause
	| offset_clause limit_clause
	| limit_clause
	| offset_clause

set_rest_more ::=
	generic_set

to_or_eq ::=
	'='
	| 'TO'

var_value ::=
	a_expr
	| 'ON'

opt_on_targets_roles ::=
	'ON' targets_roles
	| 

for_grantee_clause ::=
	'FOR' name_list
	| 

ranges_kw ::=
	'TESTING_RANGES'
	| 'EXPERIMENTAL_RANGES'

table_name_with_index ::=
	table_name '@' index_name
	| table_name

opt_compact ::=
	'COMPACT'
	| 

zone_name ::=
	unrestricted_name

opt_partition ::=
	partition
	| 

partition_name ::=
	unrestricted_name

relation_expr ::=
	table_name
	| table_name '*'
	| 'ONLY' table_name
	| 'ONLY' '(' table_name ')'

set_clause ::=
	single_set_clause
	| multiple_set_clause

simple_db_object_name ::=
	name

complex_db_object_name ::=
	name '.' unrestricted_name
	| name '.' unrestricted_name '.' unrestricted_name

non_reserved_word ::=
	'identifier'
	| unreserved_keyword
	| col_name_keyword
	| type_func_name_keyword

kv_option ::=
	name '=' string_or_placeholder
	| name
	| 'SCONST' '=' string_or_placeholder
	| 'SCONST'

unrestricted_name ::=
	'identifier'
	| unreserved_keyword
	| col_name_keyword
	| type_func_name_keyword
	| reserved_keyword

transaction_mode ::=
	transaction_iso_level
	| transaction_user_priority
	| transaction_read_mode

opt_comma ::=
	','
	| 

alter_onetable_stmt ::=
	'ALTER' 'TABLE' relation_expr alter_table_cmds
	| 'ALTER' 'TABLE' 'IF' 'EXISTS' relation_expr alter_table_cmds

alter_split_stmt ::=
	'ALTER' 'TABLE' table_name 'SPLIT' 'AT' select_stmt

alter_scatter_stmt ::=
	'ALTER' 'TABLE' table_name 'SCATTER'
	| 'ALTER' 'TABLE' table_name 'SCATTER' 'FROM' '(' expr_list ')' 'TO' '(' expr_list ')'

alter_zone_table_stmt ::=
	'ALTER' 'TABLE' table_name set_zone_config
	| 'ALTER' 'PARTITION' partition_name 'OF' 'TABLE' table_name set_zone_config

alter_rename_table_stmt ::=
	'ALTER' 'TABLE' relation_expr 'RENAME' 'TO' table_name
	| 'ALTER' 'TABLE' 'IF' 'EXISTS' relation_expr 'RENAME' 'TO' table_name
	| 'ALTER' 'TABLE' relation_expr 'RENAME' opt_column column_name 'TO' column_name
	| 'ALTER' 'TABLE' 'IF' 'EXISTS' relation_expr 'RENAME' opt_column column_name 'TO' column_name

alter_oneindex_stmt ::=
	'ALTER' 'INDEX' table_name_with_index alter_index_cmds
	| 'ALTER' 'INDEX' 'IF' 'EXISTS' table_name_with_index alter_index_cmds

alter_split_index_stmt ::=
	'ALTER' 'INDEX' table_name_with_index 'SPLIT' 'AT' select_stmt

alter_scatter_index_stmt ::=
	'ALTER' 'INDEX' table_name_with_index 'SCATTER'
	| 'ALTER' 'INDEX' table_name_with_index 'SCATTER' 'FROM' '(' expr_list ')' 'TO' '(' expr_list ')'

alter_rename_index_stmt ::=
	'ALTER' 'INDEX' table_name_with_index 'RENAME' 'TO' index_name
	| 'ALTER' 'INDEX' 'IF' 'EXISTS' table_name_with_index 'RENAME' 'TO' index_name

alter_zone_index_stmt ::=
	'ALTER' 'INDEX' table_name_with_index set_zone_config

alter_rename_view_stmt ::=
	'ALTER' 'VIEW' relation_expr 'RENAME' 'TO' view_name
	| 'ALTER' 'VIEW' 'IF' 'EXISTS' relation_expr 'RENAME' 'TO' view_name

alter_rename_sequence_stmt ::=
	'ALTER' 'SEQUENCE' relation_expr 'RENAME' 'TO' sequence_name
	| 'ALTER' 'SEQUENCE' 'IF' 'EXISTS' relation_expr 'RENAME' 'TO' sequence_name

alter_sequence_options_stmt ::=
	'ALTER' 'SEQUENCE' sequence_name sequence_option_list
	| 'ALTER' 'SEQUENCE' 'IF' 'EXISTS' sequence_name sequence_option_list

alter_rename_database_stmt ::=
	'ALTER' 'DATABASE' database_name 'RENAME' 'TO' database_name

alter_zone_database_stmt ::=
	'ALTER' 'DATABASE' database_name set_zone_config

alter_zone_range_stmt ::=
	'ALTER' 'RANGE' zone_name set_zone_config

opt_with ::=
	'WITH'
	| 

changefeed_targets ::=
	single_table_pattern_list
	| 'TABLE' single_table_pattern_list

opt_changefeed_sink ::=
	'INTO' string_or_placeholder

opt_template_clause ::=
	'TEMPLATE' opt_equal non_reserved_word_or_sconst
	| 

opt_encoding_clause ::=
	'ENCODING' opt_equal non_reserved_word_or_sconst
	| 

opt_lc_collate_clause ::=
	'LC_COLLATE' opt_equal non_reserved_word_or_sconst
	| 

opt_lc_ctype_clause ::=
	'LC_CTYPE' opt_equal non_reserved_word_or_sconst
	| 

opt_unique ::=
	'UNIQUE'
	| 

opt_index_name ::=
	opt_name

opt_using_gin_btree ::=
	'USING' name
	| 

index_params ::=
	( index_elem ) ( ( ',' index_elem ) )*

opt_storing ::=
	storing '(' name_list ')'
	| 

opt_interleave ::=
	'INTERLEAVE' 'IN' 'PARENT' table_name '(' name_list ')'
	| 

opt_partition_by ::=
	partition_by
	| 

index_name ::=
	unrestricted_name

opt_table_elem_list ::=
	table_elem_list
	| 

view_name ::=
	table_name

sequence_name ::=
	db_object_name

opt_sequence_option_list ::=
	sequence_option_list
	| 

cte_list ::=
	( common_table_expr ) ( ( ',' common_table_expr ) )*

opt_index_flags ::=
	'@' index_name
	| '@' '[' iconst64 ']'
	| '@' '{' index_flags_param_list '}'
	| 

sortby_list ::=
	( sortby ) ( ( ',' sortby ) )*

select_limit_value ::=
	a_expr
	| 'ALL'

first_or_next ::=
	'FIRST'
	| 'NEXT'

opt_select_fetch_first_value ::=
	signed_iconst
	| '(' a_expr ')'
	| 

row_or_rows ::=
	'ROW'
	| 'ROWS'

target_elem ::=
	a_expr 'AS' target_name
	| a_expr 'identifier'
	| a_expr
	| '*'

table_name_with_index_list ::=
	( table_name_with_index ) ( ( ',' table_name_with_index ) )*

table_name_list ::=
	( table_name ) ( ( ',' table_name ) )*

column_def ::=
	column_name typename col_qual_list

index_def ::=
	'INDEX' opt_index_name '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'UNIQUE' 'INDEX' opt_index_name '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'INVERTED' 'INDEX' opt_name '(' index_params ')'

family_def ::=
	'FAMILY' opt_family_name '(' name_list ')'

table_constraint ::=
	'CONSTRAINT' constraint_name constraint_elem
	| constraint_elem

insert_column_item ::=
	column_name

d_expr ::=
	'ICONST'
	| 'FCONST'
	| 'SCONST'
	| 'BCONST'
	| const_typename 'SCONST'
	| interval
	| 'TRUE'
	| 'FALSE'
	| 'NULL'
	| column_path_with_star
	| '@' iconst64
	| 'PLACEHOLDER'
	| '(' a_expr ')' '.' '*'
	| '(' a_expr ')' '.' unrestricted_name
	| '(' a_expr ')'
	| func_expr
	| select_with_parens
	| labeled_row
	| 'ARRAY' select_with_parens
	| 'ARRAY' row
	| 'ARRAY' array_expr

array_subscripts ::=
	( array_subscript ) ( ( array_subscript ) )*

case_expr ::=
	'CASE' case_arg when_clause_list case_default 'END'

simple_typename ::=
	const_typename
	| character_with_length
	| const_interval

opt_array_bounds ::=
	'[' ']'
	| 

postgres_oid ::=
	'REGPROC'
	| 'REGPROCEDURE'
	| 'REGCLASS'
	| 'REGTYPE'
	| 'REGNAMESPACE'

expr_tuple1_ambiguous ::=
	'(' ')'
	| '(' tuple1_ambiguous_values ')'

math_op ::=
	'+'
	| '-'
	| '*'
	| '/'
	| 'FLOORDIV'
	| '%'
	| '&'
	| '|'
	| '^'
	| '#'
	| '<'
	| '>'
	| '='
	| 'LESS_EQUALS'
	| 'GREATER_EQUALS'
	| 'NOT_EQUALS'

attrs ::=
	( '.' unrestricted_name ) ( ( '.' unrestricted_name ) )*

scrub_option_list ::=
	( scrub_option ) ( ( ',' scrub_option ) )*

simple_select_clause ::=
	'SELECT' opt_all_clause target_list from_clause opt_where_clause group_clause having_clause window_clause
	| 'SELECT' distinct_clause target_list from_clause opt_where_clause group_clause having_clause window_clause
	| 'SELECT' distinct_on_clause target_list from_clause opt_where_clause group_clause having_clause window_clause

values_clause ::=
	( 'VALUES' '(' expr_list ')' ) ( ( ',' '(' expr_list ')' ) )*

table_clause ::=
	'TABLE' table_ref

set_operation ::=
	select_clause 'UNION' all_or_distinct select_clause
	| select_clause 'INTERSECT' all_or_distinct select_clause
	| select_clause 'EXCEPT' all_or_distinct select_clause

offset_clause ::=
	'OFFSET' a_expr
	| 'OFFSET' c_expr row_or_rows

generic_set ::=
	var_name to_or_eq var_list

targets_roles ::=
	'ROLE' name_list
	| targets

partition ::=
	'PARTITION' partition_name

single_set_clause ::=
	column_name '=' a_expr

multiple_set_clause ::=
	'(' insert_column_list ')' '=' in_expr

type_func_name_keyword ::=
	'COLLATION'
	| 'CROSS'
	| 'FAMILY'
	| 'FULL'
	| 'INNER'
	| 'ILIKE'
	| 'IS'
	| 'ISNULL'
	| 'JOIN'
	| 'LEFT'
	| 'LIKE'
	| 'MAXVALUE'
	| 'MINVALUE'
	| 'NATURAL'
	| 'NOTNULL'
	| 'OUTER'
	| 'OVERLAPS'
	| 'RIGHT'
	| 'SIMILAR'

reserved_keyword ::=
	'ALL'
	| 'ANALYSE'
	| 'ANALYZE'
	| 'AND'
	| 'ANY'
	| 'ARRAY'
	| 'AS'
	| 'ASC'
	| 'ASYMMETRIC'
	| 'BOTH'
	| 'CASE'
	| 'CAST'
	| 'CHECK'
	| 'COLLATE'
	| 'COLUMN'
	| 'CONSTRAINT'
	| 'CREATE'
	| 'CURRENT_CATALOG'
	| 'CURRENT_DATE'
	| 'CURRENT_ROLE'
	| 'CURRENT_SCHEMA'
	| 'CURRENT_TIME'
	| 'CURRENT_TIMESTAMP'
	| 'CURRENT_USER'
	| 'DEFAULT'
	| 'DEFERRABLE'
	| 'DESC'
	| 'DISTINCT'
	| 'DO'
	| 'ELSE'
	| 'END'
	| 'EXCEPT'
	| 'FALSE'
	| 'FETCH'
	| 'FOR'
	| 'FOREIGN'
	| 'FROM'
	| 'GRANT'
	| 'GROUP'
	| 'HAVING'
	| 'IN'
	| 'INDEX'
	| 'INITIALLY'
	| 'INTERSECT'
	| 'INTO'
	| 'LATERAL'
	| 'LEADING'
	| 'LIMIT'
	| 'LOCALTIME'
	| 'LOCALTIMESTAMP'
	| 'NOT'
	| 'NOTHING'
	| 'NULL'
	| 'OFFSET'
	| 'ON'
	| 'ONLY'
	| 'OR'
	| 'ORDER'
	| 'PLACING'
	| 'PRIMARY'
	| 'REFERENCES'
	| 'RETURNING'
	| 'SELECT'
	| 'SESSION_USER'
	| 'SOME'
	| 'SYMMETRIC'
	| 'TABLE'
	| 'THEN'
	| 'TO'
	| 'TRAILING'
	| 'TRUE'
	| 'UNION'
	| 'UNIQUE'
	| 'USER'
	| 'USING'
	| 'VARIADIC'
	| 'WHEN'
	| 'WHERE'
	| 'WINDOW'
	| 'WITH'

transaction_iso_level ::=
	'ISOLATION' 'LEVEL' iso_level

transaction_user_priority ::=
	'PRIORITY' user_priority

transaction_read_mode ::=
	'READ' 'ONLY'
	| 'READ' 'WRITE'

alter_table_cmds ::=
	( alter_table_cmd ) ( ( ',' alter_table_cmd ) )*

set_zone_config ::=
	'CONFIGURE' 'ZONE' 'USING' var_set_list
	| 'CONFIGURE' 'ZONE' 'DISCARD'

opt_column ::=
	'COLUMN'
	| 

column_name ::=
	name

alter_index_cmds ::=
	( alter_index_cmd ) ( ( ',' alter_index_cmd ) )*

sequence_option_list ::=
	( sequence_option_elem ) ( ( sequence_option_elem ) )*

single_table_pattern_list ::=
	( table_name ) ( ( ',' table_name ) )*

opt_equal ::=
	'='
	| 

opt_name ::=
	name
	| 

index_elem ::=
	a_expr opt_asc_desc

storing ::=
	'COVERING'
	| 'STORING'

partition_by ::=
	'PARTITION' 'BY' 'LIST' '(' name_list ')' '(' list_partitions ')'
	| 'PARTITION' 'BY' 'RANGE' '(' name_list ')' '(' range_partitions ')'
	| 'PARTITION' 'BY' 'NOTHING'

common_table_expr ::=
	table_alias_name opt_column_list 'AS' '(' preparable_stmt ')'

iconst64 ::=
	'ICONST'

index_flags_param_list ::=
	( index_flags_param ) ( ( ',' index_flags_param ) )*

sortby ::=
	a_expr opt_asc_desc
	| 'PRIMARY' 'KEY' table_name opt_asc_desc
	| 'INDEX' table_name '@' index_name opt_asc_desc

signed_iconst ::=
	'ICONST'
	| '+' 'ICONST'
	| '-' 'ICONST'

target_name ::=
	unrestricted_name

col_qual_list ::=
	(  ) ( ( col_qualification ) )*

opt_family_name ::=
	opt_name

constraint_name ::=
	name

constraint_elem ::=
	'CHECK' '(' a_expr ')'
	| 'UNIQUE' '(' index_params ')' opt_storing opt_interleave opt_partition_by
	| 'PRIMARY' 'KEY' '(' index_params ')'
	| 'FOREIGN' 'KEY' '(' name_list ')' 'REFERENCES' table_name opt_column_list reference_actions

const_typename ::=
	numeric
	| character_without_length
	| const_datetime
	| const_json
	| 'BLOB'
	| 'BYTES'
	| 'BYTEA'
	| 'TEXT'
	| 'NAME'
	| 'SERIAL'
	| 'SERIAL2'
	| 'SMALLSERIAL'
	| 'SERIAL4'
	| 'SERIAL8'
	| 'BIGSERIAL'
	| 'UUID'
	| 'INET'
	| 'OID'
	| 'OIDVECTOR'
	| 'INT2VECTOR'
	| 'identifier'

interval ::=
	const_interval 'SCONST' opt_interval

column_path_with_star ::=
	column_path
	| name '.' unrestricted_name '.' unrestricted_name '.' '*'
	| name '.' unrestricted_name '.' '*'
	| name '.' '*'

func_expr ::=
	func_application filter_clause over_clause
	| func_expr_common_subexpr

labeled_row ::=
	row
	| '(' row 'AS' name_list ')'

row ::=
	'ROW' '(' opt_expr_list ')'
	| expr_tuple_unambiguous

array_expr ::=
	'[' opt_expr_list ']'
	| '[' array_expr_list ']'

array_subscript ::=
	'[' a_expr ']'
	| '[' opt_slice_bound ':' opt_slice_bound ']'

case_arg ::=
	a_expr
	| 

when_clause_list ::=
	( when_clause ) ( ( when_clause ) )*

case_default ::=
	'ELSE' a_expr
	| 

character_with_length ::=
	character_base '(' iconst64 ')'

const_interval ::=
	'INTERVAL'

tuple1_ambiguous_values ::=
	a_expr
	| a_expr ','
	| a_expr ',' expr_list

scrub_option ::=
	'INDEX' 'ALL'
	| 'INDEX' '(' name_list ')'
	| 'CONSTRAINT' 'ALL'
	| 'CONSTRAINT' '(' name_list ')'
	| 'PHYSICAL'

opt_all_clause ::=
	'ALL'
	| 

from_clause ::=
	'FROM' from_list opt_as_of_clause
	| 

group_clause ::=
	'GROUP' 'BY' expr_list
	| 

having_clause ::=
	'HAVING' a_expr
	| 

window_clause ::=
	'WINDOW' window_definition_list
	| 

distinct_clause ::=
	'DISTINCT'

distinct_on_clause ::=
	'DISTINCT' 'ON' '(' expr_list ')'

table_ref ::=
	relation_expr opt_index_flags opt_ordinality opt_alias_clause
	| select_with_parens opt_ordinality opt_alias_clause
	| joined_table
	| '(' joined_table ')' opt_ordinality alias_clause
	| func_table opt_ordinality opt_alias_clause
	| '[' preparable_stmt ']' opt_ordinality opt_alias_clause

all_or_distinct ::=
	'ALL'
	| 'DISTINCT'
	| 

var_list ::=
	( var_value ) ( ( ',' var_value ) )*

iso_level ::=
	'READ' 'UNCOMMITTED'
	| 'READ' 'COMMITTED'
	| 'SNAPSHOT'
	| 'REPEATABLE' 'READ'
	| 'SERIALIZABLE'

user_priority ::=
	'LOW'
	| 'NORMAL'
	| 'HIGH'

alter_table_cmd ::=
	'ADD' column_def
	| 'ADD' 'IF' 'NOT' 'EXISTS' column_def
	| 'ADD' 'COLUMN' column_def
	| 'ADD' 'COLUMN' 'IF' 'NOT' 'EXISTS' column_def
	| 'ALTER' opt_column column_name alter_column_default
	| 'ALTER' opt_column column_name 'DROP' 'NOT' 'NULL'
	| 'ALTER' opt_column column_name 'DROP' 'STORED'
	| 'DROP' opt_column 'IF' 'EXISTS' column_name opt_drop_behavior
	| 'DROP' opt_column column_name opt_drop_behavior
	| 'ALTER' opt_column column_name opt_set_data 'TYPE' typename opt_collate opt_alter_column_using
	| 'ADD' table_constraint opt_validate_behavior
	| 'VALIDATE' 'CONSTRAINT' constraint_name
	| 'DROP' 'CONSTRAINT' 'IF' 'EXISTS' constraint_name opt_drop_behavior
	| 'DROP' 'CONSTRAINT' constraint_name opt_drop_behavior
	| 'EXPERIMENTAL_AUDIT' 'SET' audit_mode
	| partition_by

var_set_list ::=
	( var_name '=' var_value ) ( ( ',' var_name '=' var_value ) )*

alter_index_cmd ::=
	partition_by

sequence_option_elem ::=
	'NO' 'CYCLE'
	| 'INCREMENT' signed_iconst64
	| 'INCREMENT' 'BY' signed_iconst64
	| 'MINVALUE' signed_iconst64
	| 'NO' 'MINVALUE'
	| 'MAXVALUE' signed_iconst64
	| 'NO' 'MAXVALUE'
	| 'START' signed_iconst64
	| 'START' 'WITH' signed_iconst64
	| 'VIRTUAL'

opt_asc_desc ::=
	'ASC'
	| 'DESC'
	| 

list_partitions ::=
	( list_partition ) ( ( ',' list_partition ) )*

range_partitions ::=
	( range_partition ) ( ( ',' range_partition ) )*

index_flags_param ::=
	'FORCE_INDEX' '=' index_name
	| 'NO_INDEX_JOIN'

col_qualification ::=
	'CONSTRAINT' constraint_name col_qualification_elem
	| col_qualification_elem
	| 'COLLATE' collation_name
	| 'FAMILY' family_name
	| 'CREATE' 'FAMILY' family_name
	| 'CREATE' 'FAMILY'
	| 'CREATE' 'IF' 'NOT' 'EXISTS' 'FAMILY' family_name

reference_actions ::=
	reference_on_update
	| reference_on_delete
	| reference_on_update reference_on_delete
	| reference_on_delete reference_on_update
	| 

numeric ::=
	'INT'
	| 'INTEGER'
	| 'INT2'
	| 'SMALLINT'
	| 'INT4'
	| 'INT8'
	| 'INT64'
	| 'BIGINT'
	| 'REAL'
	| 'FLOAT4'
	| 'FLOAT8'
	| 'FLOAT' opt_float
	| 'DOUBLE' 'PRECISION'
	| 'DECIMAL' opt_numeric_modifiers
	| 'DEC' opt_numeric_modifiers
	| 'NUMERIC' opt_numeric_modifiers
	| 'BOOLEAN'
	| 'BOOL'

character_without_length ::=
	character_base

const_datetime ::=
	'DATE'
	| 'TIMESTAMP' opt_timezone
	| 'TIMESTAMPTZ'

const_json ::=
	'JSON'
	| 'JSONB'

opt_interval ::=
	interval_qualifier
	| 

column_path ::=
	name
	| prefixed_column_path

func_application ::=
	func_name '(' ')'
	| func_name '(' expr_list ')'
	| func_name '(' 'ALL' expr_list ')'
	| func_name '(' 'DISTINCT' expr_list ')'
	| func_name '(' '*' ')'

filter_clause ::=
	'FILTER' '(' 'WHERE' a_expr ')'
	| 

over_clause ::=
	'OVER' window_specification
	| 'OVER' window_name
	| 

func_expr_common_subexpr ::=
	'CURRENT_DATE'
	| 'CURRENT_SCHEMA'
	| 'CURRENT_CATALOG'
	| 'CURRENT_TIMESTAMP'
	| 'CURRENT_USER'
	| 'CURRENT_ROLE'
	| 'SESSION_USER'
	| 'USER'
	| 'CAST' '(' a_expr 'AS' cast_target ')'
	| 'ANNOTATE_TYPE' '(' a_expr ',' typename ')'
	| 'IF' '(' a_expr ',' a_expr ',' a_expr ')'
	| 'IFERROR' '(' a_expr ',' a_expr ',' a_expr ')'
	| 'IFERROR' '(' a_expr ',' a_expr ')'
	| 'ISERROR' '(' a_expr ')'
	| 'ISERROR' '(' a_expr ',' a_expr ')'
	| 'NULLIF' '(' a_expr ',' a_expr ')'
	| 'IFNULL' '(' a_expr ',' a_expr ')'
	| 'COALESCE' '(' expr_list ')'
	| special_function

opt_expr_list ::=
	expr_list
	| 

expr_tuple_unambiguous ::=
	'(' ')'
	| '(' tuple1_unambiguous_values ')'

array_expr_list ::=
	( array_expr ) ( ( ',' array_expr ) )*

opt_slice_bound ::=
	a_expr
	| 

when_clause ::=
	'WHEN' a_expr 'THEN' a_expr

character_base ::=
	char_aliases
	| char_aliases 'VARYING'
	| 'VARCHAR'
	| 'STRING'

from_list ::=
	( table_ref ) ( ( ',' table_ref ) )*

window_definition_list ::=
	( window_definition ) ( ( ',' window_definition ) )*

opt_ordinality ::=
	'WITH' 'ORDINALITY'
	| 

opt_alias_clause ::=
	alias_clause
	| 

joined_table ::=
	'(' joined_table ')'
	| table_ref 'CROSS' 'JOIN' table_ref
	| table_ref join_type 'JOIN' table_ref join_qual
	| table_ref 'JOIN' table_ref join_qual
	| table_ref 'NATURAL' join_type 'JOIN' table_ref
	| table_ref 'NATURAL' 'JOIN' table_ref

alias_clause ::=
	'AS' table_alias_name opt_column_list
	| table_alias_name opt_column_list

func_table ::=
	func_expr_windowless
	| 'ROWS' 'FROM' '(' rowsfrom_list ')'

alter_column_default ::=
	'SET' 'DEFAULT' a_expr
	| 'DROP' 'DEFAULT'

opt_set_data ::=
	'SET' 'DATA'
	| 

opt_collate ::=
	'COLLATE' collation_name
	| 

opt_alter_column_using ::=
	'USING' a_expr
	| 

opt_validate_behavior ::=
	'NOT' 'VALID'
	| 

audit_mode ::=
	'READ' 'WRITE'
	| 'OFF'

signed_iconst64 ::=
	signed_iconst

list_partition ::=
	partition 'VALUES' 'IN' '(' expr_list ')' opt_partition_by

range_partition ::=
	partition 'VALUES' 'FROM' '(' expr_list ')' 'TO' '(' expr_list ')' opt_partition_by

col_qualification_elem ::=
	'NOT' 'NULL'
	| 'NULL'
	| 'UNIQUE'
	| 'PRIMARY' 'KEY'
	| 'CHECK' '(' a_expr ')'
	| 'DEFAULT' b_expr
	| 'REFERENCES' table_name opt_name_parens reference_actions
	| 'AS' '(' a_expr ')' 'STORED'

family_name ::=
	name

reference_on_update ::=
	'ON' 'UPDATE' reference_action

reference_on_delete ::=
	'ON' 'DELETE' reference_action

opt_float ::=
	'(' 'ICONST' ')'
	| 

opt_numeric_modifiers ::=
	'(' iconst64 ')'
	| '(' iconst64 ',' iconst64 ')'
	| 

opt_timezone ::=
	'WITH' 'TIME' 'ZONE'
	| 'WITHOUT' 'TIME' 'ZONE'
	| 

interval_qualifier ::=
	'YEAR'
	| 'MONTH'
	| 'DAY'
	| 'HOUR'
	| 'MINUTE'
	| interval_second
	| 'YEAR' 'TO' 'MONTH'
	| 'DAY' 'TO' 'HOUR'
	| 'DAY' 'TO' 'MINUTE'
	| 'DAY' 'TO' interval_second
	| 'HOUR' 'TO' 'MINUTE'
	| 'HOUR' 'TO' interval_second
	| 'MINUTE' 'TO' interval_second

prefixed_column_path ::=
	name '.' unrestricted_name
	| name '.' unrestricted_name '.' unrestricted_name
	| name '.' unrestricted_name '.' unrestricted_name '.' unrestricted_name

func_name ::=
	type_function_name
	| prefixed_column_path

window_specification ::=
	'(' opt_existing_window_name opt_partition_clause opt_sort_clause opt_frame_clause ')'

window_name ::=
	name

special_function ::=
	'CURRENT_DATE' '(' ')'
	| 'CURRENT_SCHEMA' '(' ')'
	| 'CURRENT_TIMESTAMP' '(' ')'
	| 'CURRENT_USER' '(' ')'
	| 'EXTRACT' '(' extract_list ')'
	| 'EXTRACT_DURATION' '(' extract_list ')'
	| 'OVERLAY' '(' overlay_list ')'
	| 'POSITION' '(' position_list ')'
	| 'SUBSTRING' '(' substr_list ')'
	| 'TRIM' '(' 'BOTH' trim_list ')'
	| 'TRIM' '(' 'LEADING' trim_list ')'
	| 'TRIM' '(' 'TRAILING' trim_list ')'
	| 'TRIM' '(' trim_list ')'
	| 'GREATEST' '(' expr_list ')'
	| 'LEAST' '(' expr_list ')'

tuple1_unambiguous_values ::=
	a_expr ','
	| a_expr ',' expr_list

char_aliases ::=
	'CHAR'
	| 'CHARACTER'

window_definition ::=
	window_name 'AS' window_specification

join_type ::=
	'FULL' join_outer
	| 'LEFT' join_outer
	| 'RIGHT' join_outer
	| 'INNER'

join_qual ::=
	'USING' '(' name_list ')'
	| 'ON' a_expr

func_expr_windowless ::=
	func_application
	| func_expr_common_subexpr

rowsfrom_list ::=
	( rowsfrom_item ) ( ( ',' rowsfrom_item ) )*

opt_name_parens ::=
	'(' name ')'
	| 

reference_action ::=
	'NO' 'ACTION'
	| 'RESTRICT'
	| 'CASCADE'
	| 'SET' 'NULL'
	| 'SET' 'DEFAULT'

interval_second ::=
	'SECOND'

type_function_name ::=
	'identifier'
	| unreserved_keyword
	| type_func_name_keyword

opt_existing_window_name ::=
	name
	| 

opt_partition_clause ::=
	'PARTITION' 'BY' expr_list
	| 

opt_frame_clause ::=
	'RANGE' frame_extent
	| 'ROWS' frame_extent
	| 'GROUPS' frame_extent
	| 

extract_list ::=
	extract_arg 'FROM' a_expr
	| expr_list

overlay_list ::=
	a_expr overlay_placing substr_from substr_for
	| a_expr overlay_placing substr_from
	| expr_list

position_list ::=
	b_expr 'IN' b_expr
	| 

substr_list ::=
	a_expr substr_from substr_for
	| a_expr substr_for substr_from
	| a_expr substr_from
	| a_expr substr_for
	| opt_expr_list

trim_list ::=
	a_expr 'FROM' expr_list
	| 'FROM' expr_list
	| expr_list

join_outer ::=
	'OUTER'
	| 

rowsfrom_item ::=
	func_expr_windowless

frame_extent ::=
	frame_bound
	| 'BETWEEN' frame_bound 'AND' frame_bound

extract_arg ::=
	'identifier'
	| 'YEAR'
	| 'MONTH'
	| 'DAY'
	| 'HOUR'
	| 'MINUTE'
	| 'SECOND'

overlay_placing ::=
	'PLACING' a_expr

substr_from ::=
	'FROM' a_expr

substr_for ::=
	'FOR' a_expr

frame_bound ::=
	'UNBOUNDED' 'PRECEDING'
	| 'UNBOUNDED' 'FOLLOWING'
	| 'CURRENT' 'ROW'
	| a_expr 'PRECEDING'
	| a_expr 'FOLLOWING'
