feat: pgsql: optimize drop rule's content

This commit is contained in:
zhaoge
2023-11-17 16:32:53 +08:00
committed by Hayden
parent 4736a65e0c
commit adeb26b7df
6 changed files with 18540 additions and 19536 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,6 @@ import { AlterroutinestmtContext } from "./PostgreSQLParser";
import { Alter_routine_cluaseContext } from "./PostgreSQLParser";
import { Routine_action_listContext } from "./PostgreSQLParser";
import { Routine_actionContext } from "./PostgreSQLParser";
import { DroprolestmtContext } from "./PostgreSQLParser";
import { CreategroupstmtContext } from "./PostgreSQLParser";
import { AltergroupstmtContext } from "./PostgreSQLParser";
import { Add_dropContext } from "./PostgreSQLParser";
@ -183,7 +182,6 @@ import { Opt_validatorContext } from "./PostgreSQLParser";
import { Opt_proceduralContext } from "./PostgreSQLParser";
import { CreatetablespacestmtContext } from "./PostgreSQLParser";
import { OpttablespaceownerContext } from "./PostgreSQLParser";
import { DroptablespacestmtContext } from "./PostgreSQLParser";
import { CreateextensionstmtContext } from "./PostgreSQLParser";
import { Create_extension_opt_listContext } from "./PostgreSQLParser";
import { Create_extension_opt_itemContext } from "./PostgreSQLParser";
@ -215,7 +213,6 @@ import { Import_qualification_typeContext } from "./PostgreSQLParser";
import { Import_qualificationContext } from "./PostgreSQLParser";
import { CreateusermappingstmtContext } from "./PostgreSQLParser";
import { Auth_identContext } from "./PostgreSQLParser";
import { DropusermappingstmtContext } from "./PostgreSQLParser";
import { AlterusermappingstmtContext } from "./PostgreSQLParser";
import { CreatepolicystmtContext } from "./PostgreSQLParser";
import { AlterpolicystmtContext } from "./PostgreSQLParser";
@ -283,15 +280,9 @@ import { CreateopfamilystmtContext } from "./PostgreSQLParser";
import { AlteropfamilystmtContext } from "./PostgreSQLParser";
import { Opclass_drop_listContext } from "./PostgreSQLParser";
import { Opclass_dropContext } from "./PostgreSQLParser";
import { DropopclassstmtContext } from "./PostgreSQLParser";
import { DropopfamilystmtContext } from "./PostgreSQLParser";
import { DropownedstmtContext } from "./PostgreSQLParser";
import { ReassignownedstmtContext } from "./PostgreSQLParser";
import { DropstmtContext } from "./PostgreSQLParser";
import { DropviewstmtContext } from "./PostgreSQLParser";
import { View_nameListContext } from "./PostgreSQLParser";
import { DropschemastmtContext } from "./PostgreSQLParser";
import { Object_type_any_name_listContext } from "./PostgreSQLParser";
import { Object_type_any_nameContext } from "./PostgreSQLParser";
import { Object_type_nameContext } from "./PostgreSQLParser";
import { Object_type_name_on_any_nameContext } from "./PostgreSQLParser";
@ -391,11 +382,9 @@ import { Dostmt_opt_listContext } from "./PostgreSQLParser";
import { Dostmt_opt_itemContext } from "./PostgreSQLParser";
import { CreatecaststmtContext } from "./PostgreSQLParser";
import { Cast_contextContext } from "./PostgreSQLParser";
import { DropcaststmtContext } from "./PostgreSQLParser";
import { Opt_if_existsContext } from "./PostgreSQLParser";
import { CreatetransformstmtContext } from "./PostgreSQLParser";
import { Transform_element_listContext } from "./PostgreSQLParser";
import { DroptransformstmtContext } from "./PostgreSQLParser";
import { ReindexstmtContext } from "./PostgreSQLParser";
import { Reindex_target_typeContext } from "./PostgreSQLParser";
import { Reindex_target_multitableContext } from "./PostgreSQLParser";
@ -422,7 +411,6 @@ import { CreatesubscriptionstmtContext } from "./PostgreSQLParser";
import { Publication_name_listContext } from "./PostgreSQLParser";
import { Publication_name_itemContext } from "./PostgreSQLParser";
import { AltersubscriptionstmtContext } from "./PostgreSQLParser";
import { DropsubscriptionstmtContext } from "./PostgreSQLParser";
import { RulestmtContext } from "./PostgreSQLParser";
import { RuleactionlistContext } from "./PostgreSQLParser";
import { RuleactionmultiContext } from "./PostgreSQLParser";
@ -451,7 +439,6 @@ import { Createdb_opt_nameContext } from "./PostgreSQLParser";
import { Opt_equalContext } from "./PostgreSQLParser";
import { AlterdatabasestmtContext } from "./PostgreSQLParser";
import { AlterdatabasesetstmtContext } from "./PostgreSQLParser";
import { DropdbstmtContext } from "./PostgreSQLParser";
import { Drop_option_listContext } from "./PostgreSQLParser";
import { Drop_optionContext } from "./PostgreSQLParser";
import { AltercollationstmtContext } from "./PostgreSQLParser";
@ -1242,17 +1229,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitRoutine_action?: (ctx: Routine_actionContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.droprolestmt`.
* @param ctx the parse tree
*/
enterDroprolestmt?: (ctx: DroprolestmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.droprolestmt`.
* @param ctx the parse tree
*/
exitDroprolestmt?: (ctx: DroprolestmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.creategroupstmt`.
* @param ctx the parse tree
@ -2892,17 +2868,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitOpttablespaceowner?: (ctx: OpttablespaceownerContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.droptablespacestmt`.
* @param ctx the parse tree
*/
enterDroptablespacestmt?: (ctx: DroptablespacestmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.droptablespacestmt`.
* @param ctx the parse tree
*/
exitDroptablespacestmt?: (ctx: DroptablespacestmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.createextensionstmt`.
* @param ctx the parse tree
@ -3244,17 +3209,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitAuth_ident?: (ctx: Auth_identContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropusermappingstmt`.
* @param ctx the parse tree
*/
enterDropusermappingstmt?: (ctx: DropusermappingstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropusermappingstmt`.
* @param ctx the parse tree
*/
exitDropusermappingstmt?: (ctx: DropusermappingstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.alterusermappingstmt`.
* @param ctx the parse tree
@ -3992,39 +3946,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitOpclass_drop?: (ctx: Opclass_dropContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropopclassstmt`.
* @param ctx the parse tree
*/
enterDropopclassstmt?: (ctx: DropopclassstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropopclassstmt`.
* @param ctx the parse tree
*/
exitDropopclassstmt?: (ctx: DropopclassstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropopfamilystmt`.
* @param ctx the parse tree
*/
enterDropopfamilystmt?: (ctx: DropopfamilystmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropopfamilystmt`.
* @param ctx the parse tree
*/
exitDropopfamilystmt?: (ctx: DropopfamilystmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropownedstmt`.
* @param ctx the parse tree
*/
enterDropownedstmt?: (ctx: DropownedstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropownedstmt`.
* @param ctx the parse tree
*/
exitDropownedstmt?: (ctx: DropownedstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.reassignownedstmt`.
* @param ctx the parse tree
@ -4047,17 +3968,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitDropstmt?: (ctx: DropstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropviewstmt`.
* @param ctx the parse tree
*/
enterDropviewstmt?: (ctx: DropviewstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropviewstmt`.
* @param ctx the parse tree
*/
exitDropviewstmt?: (ctx: DropviewstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.view_nameList`.
* @param ctx the parse tree
@ -4069,28 +3979,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitView_nameList?: (ctx: View_nameListContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropschemastmt`.
* @param ctx the parse tree
*/
enterDropschemastmt?: (ctx: DropschemastmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropschemastmt`.
* @param ctx the parse tree
*/
exitDropschemastmt?: (ctx: DropschemastmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.object_type_any_name_list`.
* @param ctx the parse tree
*/
enterObject_type_any_name_list?: (ctx: Object_type_any_name_listContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.object_type_any_name_list`.
* @param ctx the parse tree
*/
exitObject_type_any_name_list?: (ctx: Object_type_any_name_listContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.object_type_any_name`.
* @param ctx the parse tree
@ -5180,17 +5068,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitCast_context?: (ctx: Cast_contextContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropcaststmt`.
* @param ctx the parse tree
*/
enterDropcaststmt?: (ctx: DropcaststmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropcaststmt`.
* @param ctx the parse tree
*/
exitDropcaststmt?: (ctx: DropcaststmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.opt_if_exists`.
* @param ctx the parse tree
@ -5224,17 +5101,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitTransform_element_list?: (ctx: Transform_element_listContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.droptransformstmt`.
* @param ctx the parse tree
*/
enterDroptransformstmt?: (ctx: DroptransformstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.droptransformstmt`.
* @param ctx the parse tree
*/
exitDroptransformstmt?: (ctx: DroptransformstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.reindexstmt`.
* @param ctx the parse tree
@ -5521,17 +5387,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitAltersubscriptionstmt?: (ctx: AltersubscriptionstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropsubscriptionstmt`.
* @param ctx the parse tree
*/
enterDropsubscriptionstmt?: (ctx: DropsubscriptionstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropsubscriptionstmt`.
* @param ctx the parse tree
*/
exitDropsubscriptionstmt?: (ctx: DropsubscriptionstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.rulestmt`.
* @param ctx the parse tree
@ -5840,17 +5695,6 @@ export interface PostgreSQLParserListener extends ParseTreeListener {
*/
exitAlterdatabasesetstmt?: (ctx: AlterdatabasesetstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.dropdbstmt`.
* @param ctx the parse tree
*/
enterDropdbstmt?: (ctx: DropdbstmtContext) => void;
/**
* Exit a parse tree produced by `PostgreSQLParser.dropdbstmt`.
* @param ctx the parse tree
*/
exitDropdbstmt?: (ctx: DropdbstmtContext) => void;
/**
* Enter a parse tree produced by `PostgreSQLParser.drop_option_list`.
* @param ctx the parse tree

View File

@ -33,7 +33,6 @@ import { AlterroutinestmtContext } from "./PostgreSQLParser";
import { Alter_routine_cluaseContext } from "./PostgreSQLParser";
import { Routine_action_listContext } from "./PostgreSQLParser";
import { Routine_actionContext } from "./PostgreSQLParser";
import { DroprolestmtContext } from "./PostgreSQLParser";
import { CreategroupstmtContext } from "./PostgreSQLParser";
import { AltergroupstmtContext } from "./PostgreSQLParser";
import { Add_dropContext } from "./PostgreSQLParser";
@ -183,7 +182,6 @@ import { Opt_validatorContext } from "./PostgreSQLParser";
import { Opt_proceduralContext } from "./PostgreSQLParser";
import { CreatetablespacestmtContext } from "./PostgreSQLParser";
import { OpttablespaceownerContext } from "./PostgreSQLParser";
import { DroptablespacestmtContext } from "./PostgreSQLParser";
import { CreateextensionstmtContext } from "./PostgreSQLParser";
import { Create_extension_opt_listContext } from "./PostgreSQLParser";
import { Create_extension_opt_itemContext } from "./PostgreSQLParser";
@ -215,7 +213,6 @@ import { Import_qualification_typeContext } from "./PostgreSQLParser";
import { Import_qualificationContext } from "./PostgreSQLParser";
import { CreateusermappingstmtContext } from "./PostgreSQLParser";
import { Auth_identContext } from "./PostgreSQLParser";
import { DropusermappingstmtContext } from "./PostgreSQLParser";
import { AlterusermappingstmtContext } from "./PostgreSQLParser";
import { CreatepolicystmtContext } from "./PostgreSQLParser";
import { AlterpolicystmtContext } from "./PostgreSQLParser";
@ -283,15 +280,9 @@ import { CreateopfamilystmtContext } from "./PostgreSQLParser";
import { AlteropfamilystmtContext } from "./PostgreSQLParser";
import { Opclass_drop_listContext } from "./PostgreSQLParser";
import { Opclass_dropContext } from "./PostgreSQLParser";
import { DropopclassstmtContext } from "./PostgreSQLParser";
import { DropopfamilystmtContext } from "./PostgreSQLParser";
import { DropownedstmtContext } from "./PostgreSQLParser";
import { ReassignownedstmtContext } from "./PostgreSQLParser";
import { DropstmtContext } from "./PostgreSQLParser";
import { DropviewstmtContext } from "./PostgreSQLParser";
import { View_nameListContext } from "./PostgreSQLParser";
import { DropschemastmtContext } from "./PostgreSQLParser";
import { Object_type_any_name_listContext } from "./PostgreSQLParser";
import { Object_type_any_nameContext } from "./PostgreSQLParser";
import { Object_type_nameContext } from "./PostgreSQLParser";
import { Object_type_name_on_any_nameContext } from "./PostgreSQLParser";
@ -391,11 +382,9 @@ import { Dostmt_opt_listContext } from "./PostgreSQLParser";
import { Dostmt_opt_itemContext } from "./PostgreSQLParser";
import { CreatecaststmtContext } from "./PostgreSQLParser";
import { Cast_contextContext } from "./PostgreSQLParser";
import { DropcaststmtContext } from "./PostgreSQLParser";
import { Opt_if_existsContext } from "./PostgreSQLParser";
import { CreatetransformstmtContext } from "./PostgreSQLParser";
import { Transform_element_listContext } from "./PostgreSQLParser";
import { DroptransformstmtContext } from "./PostgreSQLParser";
import { ReindexstmtContext } from "./PostgreSQLParser";
import { Reindex_target_typeContext } from "./PostgreSQLParser";
import { Reindex_target_multitableContext } from "./PostgreSQLParser";
@ -422,7 +411,6 @@ import { CreatesubscriptionstmtContext } from "./PostgreSQLParser";
import { Publication_name_listContext } from "./PostgreSQLParser";
import { Publication_name_itemContext } from "./PostgreSQLParser";
import { AltersubscriptionstmtContext } from "./PostgreSQLParser";
import { DropsubscriptionstmtContext } from "./PostgreSQLParser";
import { RulestmtContext } from "./PostgreSQLParser";
import { RuleactionlistContext } from "./PostgreSQLParser";
import { RuleactionmultiContext } from "./PostgreSQLParser";
@ -451,7 +439,6 @@ import { Createdb_opt_nameContext } from "./PostgreSQLParser";
import { Opt_equalContext } from "./PostgreSQLParser";
import { AlterdatabasestmtContext } from "./PostgreSQLParser";
import { AlterdatabasesetstmtContext } from "./PostgreSQLParser";
import { DropdbstmtContext } from "./PostgreSQLParser";
import { Drop_option_listContext } from "./PostgreSQLParser";
import { Drop_optionContext } from "./PostgreSQLParser";
import { AltercollationstmtContext } from "./PostgreSQLParser";
@ -1115,13 +1102,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitRoutine_action?: (ctx: Routine_actionContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.droprolestmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDroprolestmt?: (ctx: DroprolestmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.creategroupstmt`.
* @param ctx the parse tree
@ -2165,13 +2145,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitOpttablespaceowner?: (ctx: OpttablespaceownerContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.droptablespacestmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDroptablespacestmt?: (ctx: DroptablespacestmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.createextensionstmt`.
* @param ctx the parse tree
@ -2389,13 +2362,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitAuth_ident?: (ctx: Auth_identContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropusermappingstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropusermappingstmt?: (ctx: DropusermappingstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.alterusermappingstmt`.
* @param ctx the parse tree
@ -2865,27 +2831,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitOpclass_drop?: (ctx: Opclass_dropContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropopclassstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropopclassstmt?: (ctx: DropopclassstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropopfamilystmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropopfamilystmt?: (ctx: DropopfamilystmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropownedstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropownedstmt?: (ctx: DropownedstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.reassignownedstmt`.
* @param ctx the parse tree
@ -2900,13 +2845,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitDropstmt?: (ctx: DropstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropviewstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropviewstmt?: (ctx: DropviewstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.view_nameList`.
* @param ctx the parse tree
@ -2914,20 +2852,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitView_nameList?: (ctx: View_nameListContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropschemastmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropschemastmt?: (ctx: DropschemastmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.object_type_any_name_list`.
* @param ctx the parse tree
* @return the visitor result
*/
visitObject_type_any_name_list?: (ctx: Object_type_any_name_listContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.object_type_any_name`.
* @param ctx the parse tree
@ -3621,13 +3545,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitCast_context?: (ctx: Cast_contextContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropcaststmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropcaststmt?: (ctx: DropcaststmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.opt_if_exists`.
* @param ctx the parse tree
@ -3649,13 +3566,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitTransform_element_list?: (ctx: Transform_element_listContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.droptransformstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDroptransformstmt?: (ctx: DroptransformstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.reindexstmt`.
* @param ctx the parse tree
@ -3838,13 +3748,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitAltersubscriptionstmt?: (ctx: AltersubscriptionstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropsubscriptionstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropsubscriptionstmt?: (ctx: DropsubscriptionstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.rulestmt`.
* @param ctx the parse tree
@ -4041,13 +3944,6 @@ export interface PostgreSQLParserVisitor<Result> extends ParseTreeVisitor<Result
*/
visitAlterdatabasesetstmt?: (ctx: AlterdatabasesetstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.dropdbstmt`.
* @param ctx the parse tree
* @return the visitor result
*/
visitDropdbstmt?: (ctx: DropdbstmtContext) => Result;
/**
* Visit a parse tree produced by `PostgreSQLParser.drop_option_list`.
* @param ctx the parse tree