You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/04/07 06:59:48 UTC

[shardingsphere] branch master updated: Support Parsing `DROP RULE` in PostgreSQL (#16618)

This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 5df708e726f Support Parsing `DROP RULE` in PostgreSQL (#16618)
5df708e726f is described below

commit 5df708e726f54bba094ea9d404c896fce133c713
Author: Everly Precia Suresh <77...@users.noreply.github.com>
AuthorDate: Thu Apr 7 12:29:40 2022 +0530

    Support Parsing `DROP RULE` in PostgreSQL (#16618)
    
    * add dropRule
    
    * add dropRule
    
    * correct testcase
    
    * correct testcase
    
    * correct tests
    
    * Annotate classes
---
 .../parser/autogen/PostgreSQLStatementParser.g4    |  1 +
 .../impl/PostgreSQLDDLStatementSQLVisitor.java     |  7 +++++
 .../core/database/visitor/SQLVisitorRule.java      |  2 ++
 .../common/statement/ddl/DropRuleStatement.java    | 19 +++++-------
 .../ddl/PostgreSQLDropRuleStatement.java           | 20 ++++++-------
 .../jaxb/cases/domain/SQLParserTestCases.java      |  5 ++++
 .../statement/DropRuleStatementTestCase.java       |  2 ++
 .../{ => ddl}/DropRuleStatementTestCase.java       | 17 ++++-------
 .../src/main/resources/case/ddl/drop-rule.xml      | 22 ++++++++++++++
 .../main/resources/sql/supported/ddl/drop-rule.xml | 22 ++++++++++++++
 .../main/resources/sql/unsupported/unsupported.xml | 34 ----------------------
 11 files changed, 84 insertions(+), 67 deletions(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
index 89e32702a04..1a30af886b9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
@@ -128,6 +128,7 @@ execute
     | dropAggregate
     | dropCollation
     | dropForeignDataWrapper
+    | dropRule
     | dropType
     ) SEMI_?
     ;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
index 1edd419bc4b..edeef3161e9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
@@ -90,6 +90,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Dr
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropOwnedContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropPolicyContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropProcedureContext;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropRuleContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropSchemaContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropSequenceContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DropTableContext;
@@ -192,6 +193,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropOwnedStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropPolicyStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropProcedureStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropRuleStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropSchemaStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropSequenceStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropTableStatement;
@@ -491,6 +493,11 @@ public final class PostgreSQLDDLStatementSQLVisitor extends PostgreSQLStatementS
     public ASTNode visitDropPolicy(final DropPolicyContext ctx) {
         return new PostgreSQLDropPolicyStatement();
     }
+
+    @Override
+    public ASTNode visitDropRule(final DropRuleContext ctx) {
+        return new PostgreSQLDropRuleStatement();
+    }
     
     @SuppressWarnings("unchecked")
     @Override
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
index eecd6927a2c..4506ce07a3f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/database/visitor/SQLVisitorRule.java
@@ -83,6 +83,8 @@ public enum SQLVisitorRule {
     ALTER_STATEMENT("AlterStatement", SQLStatementType.DDL),
     
     DROP_PROCEDURE("DropProcedure", SQLStatementType.DDL),
+
+    DROP_RULE("DropRule", SQLStatementType.DDL),
     
     CREATE_FUNCTION("CreateFunction", SQLStatementType.DDL),
     
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/DropRuleStatement.java
similarity index 68%
copy from shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
copy to shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/DropRuleStatement.java
index a74ed4a5b44..dfa2fad4425 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/DropRuleStatement.java
@@ -15,17 +15,14 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement;
+package org.apache.shardingsphere.sql.parser.sql.common.statement.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
 
-import javax.xml.bind.annotation.XmlAttribute;
-
-@Getter
-@Setter
-public abstract class DropRuleStatementTestCase extends SQLParserTestCase {
-    
-    @XmlAttribute(name = "contains-exists-clause")
-    private boolean containsExistClause;
+/**
+ * Drop rule statement.
+ */
+@ToString
+public abstract class DropRuleStatement extends AbstractSQLStatement implements DDLStatement {
 }
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLDropRuleStatement.java
similarity index 64%
copy from shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
copy to shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLDropRuleStatement.java
index a74ed4a5b44..6f4c69f7140 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLDropRuleStatement.java
@@ -15,17 +15,15 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement;
+package org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropRuleStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.PostgreSQLStatement;
 
-import javax.xml.bind.annotation.XmlAttribute;
-
-@Getter
-@Setter
-public abstract class DropRuleStatementTestCase extends SQLParserTestCase {
-    
-    @XmlAttribute(name = "contains-exists-clause")
-    private boolean containsExistClause;
+/**
+ * PostgreSQL drop rule statement.
+ */
+@ToString
+public final class PostgreSQLDropRuleStatement extends DropRuleStatement implements PostgreSQLStatement {
 }
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
index bd28b17ff0d..2b66404fa53 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/SQLParserTestCases.java
@@ -155,6 +155,7 @@ import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropLanguageStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropPolicyStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropProcedureStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropRuleStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropSchemaStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropSequenceStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.DropServerStatementTestCase;
@@ -597,6 +598,9 @@ public final class SQLParserTestCases {
     
     @XmlElement(name = "drop-procedure")
     private final List<DropProcedureStatementTestCase> dropProcedureTestCase = new LinkedList<>();
+
+    @XmlElement(name = "drop-rule")
+    private final List<DropRuleStatementTestCase> dropRuleTestCases = new LinkedList<>();
     
     @XmlElement(name = "drop-server")
     private final List<DropServerStatementTestCase> dropServerTestCase = new LinkedList<>();
@@ -1313,6 +1317,7 @@ public final class SQLParserTestCases {
         putAll(dropServerTestCase, result);
         putAll(dropPolicyTestCase, result);
         putAll(dropProcedureTestCase, result);
+        putAll(dropRuleTestCases, result);
         putAll(dropFunctionTestCase, result);
         putAll(dropGroupTestCases, result);
         putAll(dropDatabaseTestCase, result);
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
index a74ed4a5b44..ef4df5c6e0e 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
@@ -21,9 +21,11 @@ import lombok.Getter;
 import lombok.Setter;
 
 import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
 
 @Getter
 @Setter
+@XmlType(name = "distsql")
 public abstract class DropRuleStatementTestCase extends SQLParserTestCase {
     
     @XmlAttribute(name = "contains-exists-clause")
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/DropRuleStatementTestCase.java
similarity index 73%
copy from shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
copy to shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/DropRuleStatementTestCase.java
index a74ed4a5b44..c5d3ec3292c 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/DropRuleStatementTestCase.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/DropRuleStatementTestCase.java
@@ -15,17 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement;
+package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
 
-import javax.xml.bind.annotation.XmlAttribute;
-
-@Getter
-@Setter
-public abstract class DropRuleStatementTestCase extends SQLParserTestCase {
-    
-    @XmlAttribute(name = "contains-exists-clause")
-    private boolean containsExistClause;
+/**
+ * Drop rule statement test case.
+ */
+public final class DropRuleStatementTestCase extends SQLParserTestCase {
 }
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-rule.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-rule.xml
new file mode 100644
index 00000000000..4367ad5edfe
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/drop-rule.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <drop-rule sql-case-id="drop_rule_if_exists" />
+    <drop-rule sql-case-id="drop_rule" />
+</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-rule.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-rule.xml
new file mode 100644
index 00000000000..ebcbff7d287
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/drop-rule.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-cases>
+    <sql-case id="drop_rule_if_exists" value="DROP RULE IF EXISTS foo ON no_such_schema.bar;" db-types="PostgreSQL" />
+    <sql-case id="drop_rule" value="drop rule def_view_test_ins on def_view_test;" db-types="PostgreSQL" />
+</sql-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
index 38df67052db..2b82fc5a983 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
@@ -45,7 +45,6 @@
     <sql-case id="comment_on_table" value="COMMENT ON TABLE attmp_wrong IS 'table comment';" db-types="PostgreSQL" />
     <sql-case id="alter_view_rename" value="ALTER VIEW attmp_view_new RENAME TO fail" db-types="PostgreSQL" />
     <sql-case id="create_table_no_valid" value="create table nv_parent (d date, check (false) no inherit not valid)" db-types="PostgreSQL" />
-    <sql-case id="drop_rule" value="drop rule def_view_test_ins on def_view_test" db-types="PostgreSQL" />
     <sql-case id="create_as_select" value="create table attest1 as select * from atacc1" db-types="PostgreSQL" />
     <sql-case id="create_temp_table" value="create temp table old_oids as select relname, oid as oldoid, relfilenode as oldfilenode from pg_class where relname like 'at_partitioned%'" db-types="PostgreSQL" />
     <sql-case id="select_case_when" value="select relname,c.oid = oldoid as orig_oid,case relfilenode when 0 then 'none' when c.oid then 'own' when oldfilenode then 'orig' else 'OTHER' end as storage, obj_description(c.oid, 'pg_class') as desc from pg_class c left join old_oids using (relname) where relname like 'at_partitioned%' order by relname" db-types="PostgreSQL" />
@@ -5336,19 +5335,6 @@
     <sql-case id="drop_by_postgresql_source_test_case196" value="DROP PUBLICATION testpubpart_forschema;" db-types="PostgreSQL"/>
     <sql-case id="drop_by_postgresql_source_test_case197" value="DROP ROUTINE IF EXISTS test_ambiguous_procname;" db-types="PostgreSQL"/>
     <sql-case id="drop_by_postgresql_source_test_case198" value="DROP ROUTINE cp_testfunc1(int);" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case199" value="DROP RULE IF EXISTS foo ON no_such_schema.bar;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case200" value="DROP RULE IF EXISTS test_rule_exists ON no_such_schema.no_such_table;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case201" value="DROP RULE IF EXISTS test_rule_exists ON no_such_table;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case202" value="DROP RULE IF EXISTS test_rule_exists ON test_exists;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case203" value="DROP RULE hat_nosert ON hats;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case204" value="DROP RULE hat_nosert_all ON hats;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case205" value="DROP RULE hat_upsert ON hats;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case206" value="DROP RULE test_rule_exists ON no_such_schema.no_such_table;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case207" value="DROP RULE test_rule_exists ON no_such_table;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case208" value="DROP RULE test_rule_exists ON test_exists;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case209" value="DROP RULE test_rule_exists ON test_exists;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case210" value="DROP RULE y_rule ON y;" db-types="PostgreSQL"/>
-    <sql-case id="drop_by_postgresql_source_test_case211" value="DROP RULE y_rule ON y;" db-types="PostgreSQL"/>
     <sql-case id="drop_by_postgresql_source_test_case212" value="DROP SERVER IF EXISTS nonexistent;" db-types="PostgreSQL"/>
     <sql-case id="drop_by_postgresql_source_test_case213" value="DROP SERVER IF EXISTS test_server_exists;" db-types="PostgreSQL"/>
     <sql-case id="drop_by_postgresql_source_test_case214" value="DROP SERVER nonexistent;" db-types="PostgreSQL"/>
@@ -8214,26 +8200,6 @@
     <sql-case id="low_drop_by_postgresql_source_test_case33" value="drop operator class part_test_int4_ops2 using hash;" db-types="PostgreSQL"/>
     <sql-case id="low_drop_by_postgresql_source_test_case37" value="drop rewrite rule nonesuch;" db-types="PostgreSQL"/>
     <sql-case id="low_drop_by_postgresql_source_test_case38" value="drop routine f1(), p1();" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case39" value="drop rule &quot;_RETURN&quot; on rules_fooview;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case40" value="drop rule 314159;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case41" value="drop rule def_view_test_ins on def_view_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case42" value="drop rule nonesuch on noplace;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case43" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case44" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case45" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case46" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case47" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case48" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case49" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case50" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case51" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case52" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case53" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case54" value="drop rule qqq on copydml_test;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case55" value="drop rule rrule on vview;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case56" value="drop rule rules_foorule on rules_foo;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case57" value="drop rule rules_foorule on rules_foo;" db-types="PostgreSQL"/>
-    <sql-case id="low_drop_by_postgresql_source_test_case58" value="drop rule;" db-types="PostgreSQL"/>
     <sql-case id="low_drop_by_postgresql_source_test_case59" value="drop table;" db-types="PostgreSQL"/>
     <sql-case id="low_drop_by_postgresql_source_test_case60" value="drop trigger child1_delete_trig on child1;" db-types="PostgreSQL"/>
     <sql-case id="low_drop_by_postgresql_source_test_case61" value="drop trigger child1_delete_trig on child1;" db-types="PostgreSQL"/>