Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(postgresql): remove mulit partitionboundspec rule #402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions src/grammar/postgresql/PostgreSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,7 @@ discardstmt
altertablestmt
: KW_ALTER KW_TABLE opt_if_exists? relation_expr (alter_table_cmds | partition_cmd)
| KW_ALTER KW_TABLE KW_ALL KW_IN opttablespace (KW_OWNED KW_BY role_list)? KW_SET KW_TABLESPACE tablespace_name_create KW_NOWAIT?
| KW_ALTER KW_TABLE opt_if_exists? table_name index_partition_cmd (
KW_FOR KW_VALUES partition_bound_spec
| KW_DEFAULT
)
| KW_ALTER KW_TABLE opt_if_exists? table_name index_partition_cmd partitionboundspec
| KW_ALTER KW_TABLE opt_if_exists? table_name KW_DETACH KW_PARTITION qualified_name (
KW_CONCURRENTLY
| KW_FINALIZE
Expand All @@ -429,26 +426,6 @@ alter_table_cmds
: alter_table_cmd (COMMA alter_table_cmd)*
;

partition_bound_spec
: KW_IN execute_param_clause
| KW_FROM partition_bound_cluase KW_TO partition_bound_cluase
| KW_WITH partition_with_cluase
;

partition_bound_cluase
: OPEN_PAREN partition_bound_choose (COMMA partition_bound_choose)* CLOSE_PAREN
;

partition_bound_choose
: execute_param_clause
| KW_MINVALUE
| KW_MAXVALUE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

试了下,发现 KW_MINVALUE | KW_MAXVALUE 都被识别为 execute_param_clauseexpr_list 了,也就变成了 expression,不过问题不大

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看一下语法文件是不是完全一致,到时候在改改

;

partition_with_cluase
: OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN
;

partition_cmd
: index_partition_cmd partitionboundspec
| KW_DETACH KW_PARTITION qualified_name
Expand Down Expand Up @@ -526,7 +503,7 @@ reloption_elem
;

partitionboundspec
: KW_FOR KW_VALUES KW_WITH OPEN_PAREN KW_MODULUS Integral COMMA KW_REMAINDER Integral CLOSE_PAREN
: KW_FOR KW_VALUES KW_WITH OPEN_PAREN KW_MODULUS numericonly COMMA KW_REMAINDER numericonly CLOSE_PAREN
| KW_FOR KW_VALUES KW_IN execute_param_clause
| KW_FOR KW_VALUES KW_FROM execute_param_clause KW_TO execute_param_clause
| KW_DEFAULT
Expand Down
6 changes: 1 addition & 5 deletions src/lib/postgresql/PostgreSqlParser.interp

Large diffs are not rendered by default.

Loading