-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
stmt_block.bnf
4661 lines (3927 loc) · 101 KB
/
stmt_block.bnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
stmt_block ::=
stmt
stmt ::=
'HELPTOKEN'
| stmt_without_legacy_transaction
| legacy_transaction_stmt
|
stmt_without_legacy_transaction ::=
preparable_stmt
| analyze_stmt
| copy_stmt
| comment_stmt
| execute_stmt
| deallocate_stmt
| discard_stmt
| grant_stmt
| prepare_stmt
| revoke_stmt
| savepoint_stmt
| reassign_owned_by_stmt
| drop_owned_by_stmt
| release_stmt
| refresh_stmt
| nonpreparable_set_stmt
| transaction_stmt
| close_cursor_stmt
| declare_cursor_stmt
| fetch_cursor_stmt
| move_cursor_stmt
| unlisten_stmt
| show_commit_timestamp_stmt
legacy_transaction_stmt ::=
legacy_begin_stmt
| legacy_end_stmt
preparable_stmt ::=
alter_stmt
| backup_stmt
| cancel_stmt
| create_stmt
| delete_stmt
| drop_stmt
| explain_stmt
| import_stmt
| insert_stmt
| pause_stmt
| reset_stmt
| restore_stmt
| resume_stmt
| export_stmt
| scrub_stmt
| select_stmt
| preparable_set_stmt
| show_stmt
| truncate_stmt
| update_stmt
| upsert_stmt
analyze_stmt ::=
'ANALYZE' analyze_target
| 'ANALYSE' analyze_target
copy_stmt ::=
'COPY' table_name opt_column_list 'FROM' 'STDIN' opt_with_copy_options opt_where_clause
| 'COPY' table_name opt_column_list 'TO' 'STDOUT' opt_with_copy_options
| 'COPY' '(' copy_to_stmt ')' 'TO' 'STDOUT' opt_with_copy_options
comment_stmt ::=
'COMMENT' 'ON' 'DATABASE' database_name 'IS' comment_text
| 'COMMENT' 'ON' 'SCHEMA' qualifiable_schema_name 'IS' comment_text
| 'COMMENT' 'ON' 'TABLE' table_name 'IS' comment_text
| 'COMMENT' 'ON' 'COLUMN' column_path 'IS' comment_text
| 'COMMENT' 'ON' 'INDEX' table_index_name 'IS' comment_text
| 'COMMENT' 'ON' 'CONSTRAINT' constraint_name 'ON' table_name 'IS' comment_text
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'
| 'DISCARD' 'SEQUENCES'
| 'DISCARD' 'TEMP'
| 'DISCARD' 'TEMPORARY'
grant_stmt ::=
'GRANT' privileges 'ON' grant_targets 'TO' role_spec_list opt_with_grant_option
| 'GRANT' privilege_list 'TO' role_spec_list
| 'GRANT' privilege_list 'TO' role_spec_list 'WITH' 'ADMIN' 'OPTION'
| 'GRANT' privileges 'ON' 'TYPE' target_types 'TO' role_spec_list opt_with_grant_option
| 'GRANT' privileges 'ON' 'SCHEMA' schema_name_list 'TO' role_spec_list opt_with_grant_option
| 'GRANT' privileges 'ON' 'ALL' 'SEQUENCES' 'IN' 'SCHEMA' schema_name_list 'TO' role_spec_list opt_with_grant_option
| 'GRANT' privileges 'ON' 'ALL' 'TABLES' 'IN' 'SCHEMA' schema_name_list 'TO' role_spec_list opt_with_grant_option
| 'GRANT' privileges 'ON' 'ALL' 'FUNCTIONS' 'IN' 'SCHEMA' schema_name_list 'TO' role_spec_list opt_with_grant_option
| 'GRANT' 'SYSTEM' privileges 'TO' role_spec_list opt_with_grant_option
prepare_stmt ::=
'PREPARE' table_alias_name prep_type_clause 'AS' preparable_stmt
revoke_stmt ::=
'REVOKE' privileges 'ON' grant_targets 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' privileges 'ON' grant_targets 'FROM' role_spec_list
| 'REVOKE' privilege_list 'FROM' role_spec_list
| 'REVOKE' 'ADMIN' 'OPTION' 'FOR' privilege_list 'FROM' role_spec_list
| 'REVOKE' privileges 'ON' 'TYPE' target_types 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' privileges 'ON' 'TYPE' target_types 'FROM' role_spec_list
| 'REVOKE' privileges 'ON' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' privileges 'ON' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' privileges 'ON' 'ALL' 'TABLES' 'IN' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' privileges 'ON' 'ALL' 'SEQUENCES' 'IN' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' privileges 'ON' 'ALL' 'TABLES' 'IN' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' privileges 'ON' 'ALL' 'FUNCTIONS' 'IN' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' privileges 'ON' 'ALL' 'FUNCTIONS' 'IN' 'SCHEMA' schema_name_list 'FROM' role_spec_list
| 'REVOKE' 'SYSTEM' privileges 'FROM' role_spec_list
| 'REVOKE' 'GRANT' 'OPTION' 'FOR' 'SYSTEM' privileges 'FROM' role_spec_list
savepoint_stmt ::=
'SAVEPOINT' name
reassign_owned_by_stmt ::=
'REASSIGN' 'OWNED' 'BY' role_spec_list 'TO' role_spec
drop_owned_by_stmt ::=
'DROP' 'OWNED' 'BY' role_spec_list opt_drop_behavior
release_stmt ::=
'RELEASE' savepoint_name
refresh_stmt ::=
'REFRESH' 'MATERIALIZED' 'VIEW' opt_concurrently view_name opt_clear_data
nonpreparable_set_stmt ::=
set_transaction_stmt
transaction_stmt ::=
begin_stmt
| commit_stmt
| rollback_stmt
| abort_stmt
close_cursor_stmt ::=
'CLOSE' 'ALL'
| 'CLOSE' cursor_name
declare_cursor_stmt ::=
'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' opt_hold 'FOR' select_stmt
fetch_cursor_stmt ::=
'FETCH' cursor_movement_specifier
move_cursor_stmt ::=
'MOVE' cursor_movement_specifier
unlisten_stmt ::=
'UNLISTEN' type_name
| 'UNLISTEN' '*'
show_commit_timestamp_stmt ::=
'SHOW' 'COMMIT' 'TIMESTAMP'
legacy_begin_stmt ::=
'BEGIN' opt_transaction begin_transaction
legacy_end_stmt ::=
'END' opt_transaction
alter_stmt ::=
alter_ddl_stmt
| alter_role_stmt
backup_stmt ::=
'BACKUP' opt_backup_targets 'INTO' sconst_or_placeholder 'IN' string_or_placeholder_opt_list opt_as_of_clause opt_with_backup_options
| 'BACKUP' opt_backup_targets 'INTO' string_or_placeholder_opt_list opt_as_of_clause opt_with_backup_options
| 'BACKUP' opt_backup_targets 'INTO' 'LATEST' 'IN' string_or_placeholder_opt_list opt_as_of_clause opt_with_backup_options
| 'BACKUP' opt_backup_targets 'TO' string_or_placeholder_opt_list opt_as_of_clause opt_incremental opt_with_backup_options
cancel_stmt ::=
cancel_jobs_stmt
| cancel_queries_stmt
| cancel_sessions_stmt
| cancel_all_jobs_stmt
create_stmt ::=
create_role_stmt
| create_ddl_stmt
| create_stats_stmt
| create_changefeed_stmt
| create_extension_stmt
| create_external_connection_stmt
| create_schedule_stmt
delete_stmt ::=
opt_with_clause 'DELETE' 'FROM' table_expr_opt_alias_idx opt_using_clause opt_where_clause opt_sort_clause opt_limit_clause returning_clause
drop_stmt ::=
drop_ddl_stmt
| drop_role_stmt
| drop_schedule_stmt
| drop_external_connection_stmt
explain_stmt ::=
'EXPLAIN' explainable_stmt
| 'EXPLAIN' '(' explain_option_list ')' explainable_stmt
| 'EXPLAIN' 'ANALYZE' explainable_stmt
| 'EXPLAIN' 'ANALYSE' explainable_stmt
| 'EXPLAIN' 'ANALYZE' '(' explain_option_list ')' explainable_stmt
| 'EXPLAIN' 'ANALYSE' '(' explain_option_list ')' explainable_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' 'INTO' table_name '(' insert_column_list ')' import_format 'DATA' '(' string_or_placeholder_list ')' opt_with_options
| 'IMPORT' 'INTO' table_name 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_jobs_stmt
| pause_schedules_stmt
| pause_all_jobs_stmt
reset_stmt ::=
reset_session_stmt
| reset_csetting_stmt
restore_stmt ::=
'RESTORE' 'FROM' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' 'FROM' string_or_placeholder 'IN' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' backup_targets 'FROM' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' backup_targets 'FROM' string_or_placeholder 'IN' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' 'SYSTEM' 'USERS' 'FROM' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
| 'RESTORE' 'SYSTEM' 'USERS' 'FROM' string_or_placeholder 'IN' list_of_string_or_placeholder_opt_list opt_as_of_clause opt_with_restore_options
resume_stmt ::=
resume_jobs_stmt
| resume_schedules_stmt
| resume_all_jobs_stmt
export_stmt ::=
'EXPORT' 'INTO' import_format string_or_placeholder opt_with_options 'FROM' 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_local_stmt
| set_csetting_stmt
| use_stmt
show_stmt ::=
show_backup_stmt
| show_columns_stmt
| show_constraints_stmt
| show_create_stmt
| show_create_schedules_stmt
| show_create_external_connections_stmt
| show_databases_stmt
| show_enums_stmt
| show_types_stmt
| show_functions_stmt
| show_grants_stmt
| show_indexes_stmt
| show_partitions_stmt
| show_jobs_stmt
| show_locality_stmt
| show_schedules_stmt
| show_statements_stmt
| show_ranges_stmt
| show_range_for_row_stmt
| show_regions_stmt
| show_survival_goal_stmt
| show_roles_stmt
| show_savepoint_stmt
| show_schemas_stmt
| show_sequences_stmt
| show_session_stmt
| show_sessions_stmt
| show_stats_stmt
| show_tables_stmt
| show_trace_stmt
| show_transactions_stmt
| show_transfer_stmt
| show_users_stmt
| show_zone_stmt
| show_full_scans_stmt
| show_default_privileges_stmt
truncate_stmt ::=
'TRUNCATE' opt_table relation_expr_list opt_drop_behavior
update_stmt ::=
opt_with_clause 'UPDATE' table_expr_opt_alias_idx 'SET' set_clause_list opt_from_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
analyze_target ::=
table_name
table_name ::=
db_object_name
opt_column_list ::=
'(' name_list ')'
|
opt_with_copy_options ::=
opt_with copy_options_list
| opt_with '(' copy_generic_options_list ')'
|
opt_where_clause ::=
where_clause
|
copy_to_stmt ::=
delete_stmt
| insert_stmt
| select_stmt
| update_stmt
| upsert_stmt
database_name ::=
name
comment_text ::=
'SCONST'
| 'NULL'
qualifiable_schema_name ::=
name
| name '.' name
column_path ::=
name
| prefixed_column_path
table_index_name ::=
table_name '@' index_name
| standalone_index_name
constraint_name ::=
name
table_alias_name ::=
name
execute_param_clause ::=
'(' expr_list ')'
|
name ::=
'identifier'
| unreserved_keyword
| col_name_keyword
privileges ::=
'ALL' opt_privileges_clause
| privilege_list
grant_targets ::=
'identifier'
| col_name_keyword
| unreserved_keyword
| complex_table_pattern
| 'SEQUENCE' table_pattern_list
| table_pattern ',' table_pattern_list
| 'TABLE' table_pattern_list
| 'DATABASE' name_list
| 'EXTERNAL' 'CONNECTION' name_list
| 'FUNCTION' function_with_paramtypes_list
role_spec_list ::=
( role_spec ) ( ( ',' role_spec ) )*
opt_with_grant_option ::=
'WITH' 'GRANT' 'OPTION'
|
privilege_list ::=
( privilege ) ( ( ',' privilege ) )*
target_types ::=
type_name_list
schema_name_list ::=
( qualifiable_schema_name ) ( ( ',' qualifiable_schema_name ) )*
prep_type_clause ::=
'(' type_list ')'
|
role_spec ::=
'identifier'
| unreserved_keyword
| 'CURRENT_USER'
| 'SESSION_USER'
opt_drop_behavior ::=
'CASCADE'
| 'RESTRICT'
|
savepoint_name ::=
'SAVEPOINT' name
| name
opt_concurrently ::=
'CONCURRENTLY'
|
view_name ::=
table_name
opt_clear_data ::=
'WITH' 'DATA'
| 'WITH' 'NO' 'DATA'
|
set_transaction_stmt ::=
'SET' 'TRANSACTION' transaction_mode_list
| 'SET' 'SESSION' 'TRANSACTION' transaction_mode_list
begin_stmt ::=
'START' 'TRANSACTION' begin_transaction
commit_stmt ::=
'COMMIT' opt_transaction
rollback_stmt ::=
'ROLLBACK' opt_transaction
| 'ROLLBACK' opt_transaction 'TO' savepoint_name
abort_stmt ::=
'ABORT' opt_abort_mod
cursor_name ::=
name
opt_binary ::=
'BINARY'
|
opt_sensitivity ::=
'INSENSITIVE'
| 'ASENSITIVE'
|
opt_scroll ::=
'SCROLL'
| 'NO' 'SCROLL'
|
opt_hold ::=
'WITH' 'HOLD'
| 'WITHOUT' 'HOLD'
|
cursor_movement_specifier ::=
cursor_name
| from_or_in cursor_name
| next_prior opt_from_or_in cursor_name
| forward_backward opt_from_or_in cursor_name
| opt_forward_backward signed_iconst64 opt_from_or_in cursor_name
| opt_forward_backward 'ALL' opt_from_or_in cursor_name
| 'ABSOLUTE' signed_iconst64 opt_from_or_in cursor_name
| 'RELATIVE' signed_iconst64 opt_from_or_in cursor_name
| 'FIRST' opt_from_or_in cursor_name
| 'LAST' opt_from_or_in cursor_name
type_name ::=
db_object_name
opt_transaction ::=
'TRANSACTION'
|
begin_transaction ::=
transaction_mode_list
|
alter_ddl_stmt ::=
alter_table_stmt
| alter_index_stmt
| alter_view_stmt
| alter_sequence_stmt
| alter_database_stmt
| alter_range_stmt
| alter_partition_stmt
| alter_schema_stmt
| alter_type_stmt
| alter_default_privileges_stmt
| alter_changefeed_stmt
| alter_backup_stmt
| alter_func_stmt
| alter_backup_schedule
alter_role_stmt ::=
'ALTER' role_or_group_or_user role_spec opt_role_options
| 'ALTER' role_or_group_or_user 'IF' 'EXISTS' role_spec opt_role_options
| 'ALTER' role_or_group_or_user role_spec opt_in_database set_or_reset_clause
| 'ALTER' role_or_group_or_user 'IF' 'EXISTS' role_spec opt_in_database set_or_reset_clause
| 'ALTER' 'ROLE_ALL' 'ALL' opt_in_database set_or_reset_clause
| 'ALTER' 'USER_ALL' 'ALL' opt_in_database set_or_reset_clause
opt_backup_targets ::=
backup_targets
sconst_or_placeholder ::=
'SCONST'
| 'PLACEHOLDER'
string_or_placeholder_opt_list ::=
string_or_placeholder
| '(' string_or_placeholder_list ')'
opt_as_of_clause ::=
as_of_clause
|
opt_with_backup_options ::=
'WITH' backup_options_list
| 'WITH' 'OPTIONS' '(' backup_options_list ')'
|
opt_incremental ::=
'INCREMENTAL' 'FROM' string_or_placeholder_list
|
cancel_jobs_stmt ::=
'CANCEL' 'JOB' a_expr
| 'CANCEL' 'JOBS' select_stmt
| 'CANCEL' 'JOBS' for_schedules_clause
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
cancel_all_jobs_stmt ::=
'CANCEL' 'ALL' name 'JOBS'
create_role_stmt ::=
'CREATE' role_or_group_or_user role_spec opt_role_options
| 'CREATE' role_or_group_or_user 'IF' 'NOT' 'EXISTS' role_spec opt_role_options
create_ddl_stmt ::=
create_database_stmt
| create_index_stmt
| create_schema_stmt
| create_table_stmt
| create_table_as_stmt
| create_type_stmt
| create_view_stmt
| create_sequence_stmt
| create_func_stmt
create_stats_stmt ::=
'CREATE' 'STATISTICS' statistics_name opt_stats_columns 'FROM' create_stats_target opt_create_stats_options
create_changefeed_stmt ::=
'CREATE' 'CHANGEFEED' 'FOR' changefeed_targets opt_changefeed_sink opt_with_options
| 'CREATE' 'CHANGEFEED' opt_changefeed_sink opt_with_options 'AS' 'SELECT' target_list 'FROM' changefeed_target_expr opt_where_clause
create_extension_stmt ::=
'CREATE' 'EXTENSION' 'IF' 'NOT' 'EXISTS' name
| 'CREATE' 'EXTENSION' name
create_external_connection_stmt ::=
'CREATE' 'EXTERNAL' 'CONNECTION' label_spec 'AS' string_or_placeholder
create_schedule_stmt ::=
create_schedule_for_changefeed_stmt
| create_schedule_for_backup_stmt
opt_with_clause ::=
with_clause
|
table_expr_opt_alias_idx ::=
table_name_opt_idx
| table_name_opt_idx table_alias_name
| table_name_opt_idx 'AS' table_alias_name
opt_using_clause ::=
'USING' from_list
|
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_schema_stmt
| drop_type_stmt
| drop_func_stmt
drop_role_stmt ::=
'DROP' role_or_group_or_user role_spec_list
| 'DROP' role_or_group_or_user 'IF' 'EXISTS' role_spec_list
drop_schedule_stmt ::=
'DROP' 'SCHEDULE' a_expr
| 'DROP' 'SCHEDULES' select_stmt
drop_external_connection_stmt ::=
'DROP' 'EXTERNAL' 'CONNECTION' string_or_placeholder
explainable_stmt ::=
preparable_stmt
| comment_stmt
| execute_stmt
explain_option_list ::=
( explain_option_name ) ( ( ',' explain_option_name ) )*
import_format ::=
name
string_or_placeholder ::=
non_reserved_word_or_sconst
| 'PLACEHOLDER'
opt_with_options ::=
'WITH' kv_option_list
| 'WITH' 'OPTIONS' '(' kv_option_list ')'
|
insert_column_list ::=
( insert_column_item ) ( ( ',' insert_column_item ) )*
string_or_placeholder_list ::=
( string_or_placeholder ) ( ( ',' string_or_placeholder ) )*
insert_target ::=
table_name_opt_idx
| table_name_opt_idx 'AS' table_alias_name
insert_rest ::=
select_stmt
| '(' insert_column_list ')' select_stmt
| 'DEFAULT' 'VALUES'
on_conflict ::=
'ON' 'CONFLICT' 'DO' 'NOTHING'
| 'ON' 'CONFLICT' '(' name_list ')' opt_where_clause 'DO' 'NOTHING'
| 'ON' 'CONFLICT' '(' name_list ')' opt_where_clause 'DO' 'UPDATE' 'SET' set_clause_list opt_where_clause
| 'ON' 'CONFLICT' 'ON' 'CONSTRAINT' constraint_name 'DO' 'NOTHING'
| 'ON' 'CONFLICT' 'ON' 'CONSTRAINT' constraint_name 'DO' 'UPDATE' 'SET' set_clause_list opt_where_clause
pause_jobs_stmt ::=
'PAUSE' 'JOB' a_expr
| 'PAUSE' 'JOB' a_expr 'WITH' 'REASON' '=' string_or_placeholder
| 'PAUSE' 'JOBS' select_stmt
| 'PAUSE' 'JOBS' select_stmt 'WITH' 'REASON' '=' string_or_placeholder
| 'PAUSE' 'JOBS' for_schedules_clause
pause_schedules_stmt ::=
'PAUSE' 'SCHEDULE' a_expr
| 'PAUSE' 'SCHEDULES' select_stmt
pause_all_jobs_stmt ::=
'PAUSE' 'ALL' name 'JOBS'
reset_session_stmt ::=
'RESET' session_var
| 'RESET' 'SESSION' session_var
| 'RESET_ALL' 'ALL'
reset_csetting_stmt ::=
'RESET' 'CLUSTER' 'SETTING' var_name
list_of_string_or_placeholder_opt_list ::=
( string_or_placeholder_opt_list ) ( ( ',' string_or_placeholder_opt_list ) )*
opt_with_restore_options ::=
'WITH' restore_options_list
| 'WITH' 'OPTIONS' '(' restore_options_list ')'
|
backup_targets ::=
'identifier'
| col_name_keyword
| unreserved_keyword
| complex_table_pattern
| table_pattern ',' table_pattern_list
| 'TABLE' table_pattern_list
| 'DATABASE' name_list
resume_jobs_stmt ::=
'RESUME' 'JOB' a_expr
| 'RESUME' 'JOBS' select_stmt
| 'RESUME' 'JOBS' for_schedules_clause
resume_schedules_stmt ::=
'RESUME' 'SCHEDULE' a_expr
| 'RESUME' 'SCHEDULES' select_stmt
resume_all_jobs_stmt ::=
'RESUME' 'ALL' name 'JOBS'
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 for_locking_clause opt_select_limit
| select_clause opt_sort_clause select_limit opt_for_locking_clause
| with_clause select_clause
| with_clause select_clause sort_clause
| with_clause select_clause opt_sort_clause for_locking_clause opt_select_limit
| with_clause select_clause opt_sort_clause select_limit opt_for_locking_clause
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_local_stmt ::=
'SET' 'LOCAL' set_rest
set_csetting_stmt ::=
'SET' 'CLUSTER' 'SETTING' var_name to_or_eq var_value
use_stmt ::=
'USE' var_value
show_backup_stmt ::=
'SHOW' 'BACKUPS' 'IN' string_or_placeholder_opt_list
| 'SHOW' 'BACKUP' show_backup_details 'FROM' string_or_placeholder 'IN' string_or_placeholder_opt_list opt_with_show_backup_options
| 'SHOW' 'BACKUP' string_or_placeholder 'IN' string_or_placeholder_opt_list opt_with_show_backup_options
| 'SHOW' 'BACKUP' string_or_placeholder opt_with_show_backup_options
| 'SHOW' 'BACKUP' 'SCHEMAS' string_or_placeholder opt_with_show_backup_options
| 'SHOW' 'BACKUP' 'FILES' string_or_placeholder opt_with_show_backup_options
| 'SHOW' 'BACKUP' 'RANGES' string_or_placeholder opt_with_show_backup_options
| 'SHOW' 'BACKUP' 'VALIDATE' string_or_placeholder opt_with_show_backup_options
| 'SHOW' 'BACKUP' 'CONNECTION' string_or_placeholder opt_with_show_backup_connection_options_list
show_columns_stmt ::=
'SHOW' 'COLUMNS' 'FROM' table_name with_comment
show_constraints_stmt ::=
'SHOW' 'CONSTRAINT' 'FROM' table_name with_comment
| 'SHOW' 'CONSTRAINTS' 'FROM' table_name with_comment
show_create_stmt ::=
'SHOW' 'CREATE' table_name opt_show_create_format_options
| 'SHOW' 'CREATE' 'ALL' 'SCHEMAS'
| 'SHOW' 'CREATE' 'ALL' 'TABLES'
| 'SHOW' 'CREATE' 'ALL' 'TYPES'
show_create_schedules_stmt ::=
'SHOW' 'CREATE' 'ALL' 'SCHEDULES'
| 'SHOW' 'CREATE' 'SCHEDULE' a_expr
show_create_external_connections_stmt ::=
'SHOW' 'CREATE' 'ALL' 'EXTERNAL' 'CONNECTIONS'
| 'SHOW' 'CREATE' 'EXTERNAL' 'CONNECTION' string_or_placeholder
show_databases_stmt ::=
'SHOW' 'DATABASES' with_comment
show_enums_stmt ::=
'SHOW' 'ENUMS'
| 'SHOW' 'ENUMS' 'FROM' name '.' name
| 'SHOW' 'ENUMS' 'FROM' name
show_types_stmt ::=
'SHOW' 'TYPES'
show_functions_stmt ::=
'SHOW' 'FUNCTIONS' 'FROM' name '.' name
| 'SHOW' 'FUNCTIONS' 'FROM' name
| 'SHOW' 'FUNCTIONS'
show_grants_stmt ::=
'SHOW' 'GRANTS' opt_on_targets_roles for_grantee_clause
| 'SHOW' 'SYSTEM' 'GRANTS' for_grantee_clause
show_indexes_stmt ::=
'SHOW' 'INDEX' 'FROM' table_name with_comment
| 'SHOW' 'INDEX' 'FROM' 'DATABASE' database_name with_comment
| 'SHOW' 'INDEXES' 'FROM' table_name with_comment
| 'SHOW' 'INDEXES' 'FROM' 'DATABASE' database_name with_comment
| 'SHOW' 'KEYS' 'FROM' table_name with_comment
| 'SHOW' 'KEYS' 'FROM' 'DATABASE' database_name with_comment
show_partitions_stmt ::=
'SHOW' 'PARTITIONS' 'FROM' 'TABLE' table_name
| 'SHOW' 'PARTITIONS' 'FROM' 'DATABASE' database_name
| 'SHOW' 'PARTITIONS' 'FROM' 'INDEX' table_index_name
| 'SHOW' 'PARTITIONS' 'FROM' 'INDEX' table_name '@' '*'
show_jobs_stmt ::=
'SHOW' 'AUTOMATIC' 'JOBS'
| 'SHOW' 'JOBS'
| 'SHOW' 'CHANGEFEED' 'JOBS'
| 'SHOW' 'JOBS' select_stmt
| 'SHOW' 'JOBS' 'WHEN' 'COMPLETE' select_stmt
| 'SHOW' 'JOBS' for_schedules_clause
| 'SHOW' 'CHANGEFEED' 'JOBS' select_stmt
| 'SHOW' 'JOB' a_expr
| 'SHOW' 'CHANGEFEED' 'JOB' a_expr
| 'SHOW' 'JOB' 'WHEN' 'COMPLETE' a_expr
show_locality_stmt ::=
'SHOW' 'LOCALITY'
show_schedules_stmt ::=
'SHOW' 'SCHEDULES' opt_schedule_executor_type
| 'SHOW' schedule_state 'SCHEDULES' opt_schedule_executor_type
| 'SHOW' 'SCHEDULE' a_expr
show_statements_stmt ::=
'SHOW' opt_cluster statements_or_queries
| 'SHOW' 'ALL' opt_cluster statements_or_queries
show_ranges_stmt ::=
'SHOW' 'RANGES' 'FROM' 'INDEX' table_index_name opt_show_ranges_options
| 'SHOW' 'RANGES' 'FROM' 'TABLE' table_name opt_show_ranges_options
| 'SHOW' 'RANGES' 'FROM' 'DATABASE' database_name opt_show_ranges_options
| 'SHOW' 'RANGES' 'FROM' 'CURRENT_CATALOG' opt_show_ranges_options
| 'SHOW' 'RANGES' opt_show_ranges_options
| 'SHOW' 'CLUSTER' 'RANGES' opt_show_ranges_options
show_range_for_row_stmt ::=
'SHOW' 'RANGE' 'FROM' 'TABLE' table_name 'FOR' 'ROW' '(' expr_list ')'
| 'SHOW' 'RANGE' 'FROM' 'INDEX' table_index_name 'FOR' 'ROW' '(' expr_list ')'
show_regions_stmt ::=
'SHOW' 'REGIONS' 'FROM' 'CLUSTER'
| 'SHOW' 'REGIONS' 'FROM' 'DATABASE'
| 'SHOW' 'REGIONS' 'FROM' 'ALL' 'DATABASES'
| 'SHOW' 'REGIONS' 'FROM' 'DATABASE' database_name
| 'SHOW' 'REGIONS'
| 'SHOW' 'SUPER' 'REGIONS' 'FROM' 'DATABASE' database_name
show_survival_goal_stmt ::=
'SHOW' 'SURVIVAL' 'GOAL' 'FROM' 'DATABASE'
| 'SHOW' 'SURVIVAL' 'GOAL' 'FROM' 'DATABASE' database_name
show_roles_stmt ::=
'SHOW' 'ROLES'
show_savepoint_stmt ::=
'SHOW' 'SAVEPOINT' 'STATUS'
show_schemas_stmt ::=
'SHOW' 'SCHEMAS' 'FROM' name
| 'SHOW' 'SCHEMAS'
show_sequences_stmt ::=
'SHOW' 'SEQUENCES' 'FROM' name
| 'SHOW' 'SEQUENCES'
show_session_stmt ::=
'SHOW' session_var
| 'SHOW' 'SESSION' session_var
show_sessions_stmt ::=
'SHOW' opt_cluster 'SESSIONS'
| 'SHOW' 'ALL' opt_cluster 'SESSIONS'
show_stats_stmt ::=
'SHOW' 'STATISTICS' 'FOR' 'TABLE' table_name opt_with_options
show_tables_stmt ::=
'SHOW' 'TABLES' 'FROM' name '.' name with_comment
| 'SHOW' 'TABLES' 'FROM' name with_comment
| 'SHOW' 'TABLES' with_comment
show_trace_stmt ::=
'SHOW' opt_compact 'TRACE' 'FOR' 'SESSION'
| 'SHOW' opt_compact 'KV' 'TRACE' 'FOR' 'SESSION'
show_transactions_stmt ::=
'SHOW' opt_cluster 'TRANSACTIONS'
| 'SHOW' 'ALL' opt_cluster 'TRANSACTIONS'
show_transfer_stmt ::=
'SHOW' 'TRANSFER' 'STATE' 'WITH' 'SCONST'
| 'SHOW' 'TRANSFER' 'STATE'
show_users_stmt ::=
'SHOW' 'USERS'
show_zone_stmt ::=
'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'RANGE' zone_name
| 'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'DATABASE' database_name
| 'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'TABLE' table_name opt_partition
| 'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'PARTITION' partition_name 'OF' 'TABLE' table_name
| 'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'INDEX' table_index_name opt_partition
| 'SHOW' 'ZONE' 'CONFIGURATION' from_with_implicit_for_alias 'PARTITION' partition_name 'OF' 'INDEX' table_index_name
| 'SHOW' 'ZONE' 'CONFIGURATIONS'
| 'SHOW' 'ALL' 'ZONE' 'CONFIGURATIONS'
show_full_scans_stmt ::=
'SHOW' 'FULL' 'TABLE' 'SCANS'
show_default_privileges_stmt ::=
'SHOW' 'DEFAULT' 'PRIVILEGES' opt_for_roles opt_in_schema
| 'SHOW' 'DEFAULT' 'PRIVILEGES' 'FOR' 'GRANTEE' role_spec_list opt_in_schema
| 'SHOW' 'DEFAULT' 'PRIVILEGES' 'FOR' 'ALL' 'ROLES' opt_in_schema
opt_table ::=
'TABLE'
|
relation_expr_list ::=
( relation_expr ) ( ( ',' relation_expr ) )*
set_clause_list ::=
( set_clause ) ( ( ',' set_clause ) )*
opt_from_list ::=
'FROM' from_list
|
db_object_name ::=
simple_db_object_name
| complex_db_object_name
name_list ::=
( name ) ( ( ',' name ) )*
opt_with ::=
'WITH'
|
copy_options_list ::=
( copy_options ) ( ( copy_options ) )*
copy_generic_options_list ::=
( copy_generic_options ) ( ( ',' copy_generic_options ) )*
where_clause ::=
'WHERE' a_expr
prefixed_column_path ::=
db_object_name_component '.' unrestricted_name
| db_object_name_component '.' unrestricted_name '.' unrestricted_name
| db_object_name_component '.' unrestricted_name '.' unrestricted_name '.' unrestricted_name
index_name ::=
unrestricted_name
standalone_index_name ::=
db_object_name
expr_list ::=
( a_expr ) ( ( ',' a_expr ) )*
unreserved_keyword ::=
'ABORT'
| 'ABSOLUTE'