Skip to content

Commit f3fa497

Browse files
committed
feat(postgresql): remove mulit partitionboundspec rule
1 parent 881192c commit f3fa497

File tree

5 files changed

+10942
-11471
lines changed

5 files changed

+10942
-11471
lines changed

src/grammar/postgresql/PostgreSqlParser.g4

+2-25
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,7 @@ discardstmt
409409
altertablestmt
410410
: KW_ALTER KW_TABLE opt_if_exists? relation_expr (alter_table_cmds | partition_cmd)
411411
| KW_ALTER KW_TABLE KW_ALL KW_IN opttablespace (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create KW_NOWAIT?
412-
| KW_ALTER KW_TABLE opt_if_exists? table_name index_partition_cmd (
413-
KW_FOR KW_VALUES partition_bound_spec
414-
| KW_DEFAULT
415-
)
412+
| KW_ALTER KW_TABLE opt_if_exists? table_name index_partition_cmd partitionboundspec
416413
| KW_ALTER KW_TABLE opt_if_exists? table_name KW_DETACH KW_PARTITION qualified_name (
417414
KW_CONCURRENTLY
418415
| KW_FINALIZE
@@ -429,26 +426,6 @@ alter_table_cmds
429426
: alter_table_cmd (COMMA alter_table_cmd)*
430427
;
431428

432-
partition_bound_spec
433-
: KW_IN execute_param_clause
434-
| KW_FROM partition_bound_cluase KW_TO partition_bound_cluase
435-
| KW_WITH partition_with_cluase
436-
;
437-
438-
partition_bound_cluase
439-
: OPEN_PAREN partition_bound_choose (COMMA partition_bound_choose)* CLOSE_PAREN
440-
;
441-
442-
partition_bound_choose
443-
: execute_param_clause
444-
| KW_MINVALUE
445-
| KW_MAXVALUE
446-
;
447-
448-
partition_with_cluase
449-
: OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN
450-
;
451-
452429
partition_cmd
453430
: index_partition_cmd partitionboundspec
454431
| KW_DETACH KW_PARTITION qualified_name
@@ -526,7 +503,7 @@ reloption_elem
526503
;
527504

528505
partitionboundspec
529-
: KW_FOR KW_VALUES KW_WITH OPEN_PAREN KW_MODULUS Integral COMMA KW_REMAINDER Integral CLOSE_PAREN
506+
: KW_FOR KW_VALUES KW_WITH OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN
530507
| KW_FOR KW_VALUES KW_IN execute_param_clause
531508
| KW_FOR KW_VALUES KW_FROM execute_param_clause KW_TO execute_param_clause
532509
| KW_DEFAULT

src/lib/postgresql/PostgreSqlParser.interp

+1-5
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)