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/07/27 00:42:09 UTC

[shardingsphere] branch master updated: Add PostgreSQL Create Foreign Table Statement (#19585)

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 195e7cff4d2 Add PostgreSQL Create Foreign Table Statement (#19585)
195e7cff4d2 is described below

commit 195e7cff4d26bcd434c8484f9571aa47ab2bf5bf
Author: Thanoshan MV <48...@users.noreply.github.com>
AuthorDate: Wed Jul 27 06:11:52 2022 +0530

    Add PostgreSQL Create Foreign Table Statement (#19585)
---
 .../parser/autogen/PostgreSQLStatementParser.g4    |  1 +
 .../impl/PostgreSQLDDLStatementSQLVisitor.java     | 11 ++++++--
 .../core/database/visitor/SQLVisitorRule.java      |  4 ++-
 .../statement/ddl/CreateForeignTableStatement.java | 28 +++++++++++++++++++++
 .../ddl/PostgreSQLCreateForeignTableStatement.java | 29 ++++++++++++++++++++++
 .../jaxb/cases/domain/SQLParserTestCases.java      |  4 +++
 .../ddl/CreateForeignTableStatementTestCase.java   | 26 +++++++++++++++++++
 .../resources/case/ddl/create-foreign-table.xml    | 23 +++++++++++++++++
 .../sql/supported/ddl/create-foreign-table.xml     | 23 +++++++++++++++++
 .../main/resources/sql/unsupported/unsupported.xml | 27 --------------------
 10 files changed, 146 insertions(+), 30 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 daa5558eed4..9fa94ad0317 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
@@ -169,5 +169,6 @@ execute
     | securityLabelStmt
     | createEventTrigger
     | createForeignDataWrapper
+    | createForeignTable
     ) SEMI_? EOF
     ;
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 73dc4e686b2..9ee445a60a0 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
@@ -47,8 +47,8 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Al
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterRoutineContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterRuleContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterSchemaContext;
-import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterServerContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterSequenceContext;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterServerContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterTableActionContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterTableContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.AlterTablespaceContext;
@@ -77,6 +77,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Cr
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateEventTriggerContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateExtensionContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateForeignDataWrapperContext;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateForeignTableContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateFunctionContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateIndexContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CreateLanguageContext;
@@ -216,8 +217,8 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterRoutineStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterRuleStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterSchemaStatement;
-import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterServerStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterSequenceStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterServerStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTableStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTablespaceStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTextSearchStatement;
@@ -235,6 +236,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateEventTriggerStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateExtensionStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateForeignDataWrapperStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateForeignTableStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateFunctionStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateIndexStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateLanguageStatement;
@@ -1330,4 +1332,9 @@ public final class PostgreSQLDDLStatementSQLVisitor extends PostgreSQLStatementS
     public ASTNode visitCreateForeignDataWrapper(final CreateForeignDataWrapperContext ctx) {
         return new PostgreSQLCreateForeignDataWrapperStatement();
     }
+    
+    @Override
+    public ASTNode visitCreateForeignTable(final CreateForeignTableContext ctx) {
+        return new PostgreSQLCreateForeignTableStatement();
+    }
 }
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 46ab40d64b8..a4a5f78d3c2 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
@@ -620,7 +620,9 @@ public enum SQLVisitorRule {
     
     CREATE_EVENT_TRIGGER("CreateEventTrigger", SQLStatementType.DDL),
     
-    CREATE_FOREIGN_DATA_WRAPPER("CreateForeignDataWrapper", SQLStatementType.DDL);
+    CREATE_FOREIGN_DATA_WRAPPER("CreateForeignDataWrapper", SQLStatementType.DDL),
+    
+    CREATE_FOREIGN_TABLE("CreateForeignTable", SQLStatementType.DDL);
     
     private final String name;
     
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CreateForeignTableStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CreateForeignTableStatement.java
new file mode 100644
index 00000000000..10e7af31817
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CreateForeignTableStatement.java
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.statement.ddl;
+
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
+
+/**
+ * Create foreign table statement.
+ */
+@ToString(callSuper = true)
+public abstract class CreateForeignTableStatement extends AbstractSQLStatement implements DDLStatement {
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCreateForeignTableStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCreateForeignTableStatement.java
new file mode 100644
index 00000000000..4438bd40773
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCreateForeignTableStatement.java
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl;
+
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateForeignTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.PostgreSQLStatement;
+
+/**
+ * PostgreSQL create foreign table statement.
+ */
+@ToString(callSuper = true)
+public final class PostgreSQLCreateForeignTableStatement extends CreateForeignTableStatement 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 236950fa140..db63edf8ed8 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
@@ -167,6 +167,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.CreateExtensionStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateFlashbackArchiveStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateForeignDataWrapperStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateForeignTableStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateFunctionStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateIndexStatementTestCase;
 import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl.CreateInmemoryJoinGroupStatementTestCase;
@@ -1615,6 +1616,9 @@ public final class SQLParserTestCases {
     @XmlElement(name = "show-sql-translator-rule")
     private final List<ShowSQLTranslatorRuleStatementTestCase> showSQLTranslatorRuleStatementTestCases = new LinkedList<>();
     
+    @XmlElement(name = "create-foreign-table")
+    private final List<CreateForeignTableStatementTestCase> createForeignTableStatementTestCases = new LinkedList<>();
+    
     /**
      * Get all SQL parser test cases.
      *
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/CreateForeignTableStatementTestCase.java b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/CreateForeignTableStatementTestCase.java
new file mode 100644
index 00000000000..43b271ccf95
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/ddl/CreateForeignTableStatementTestCase.java
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+package org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.ddl;
+
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
+
+/**
+ * Create foreign table statement test case.
+ */
+public final class CreateForeignTableStatementTestCase extends SQLParserTestCase {
+}
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-foreign-table.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-foreign-table.xml
new file mode 100644
index 00000000000..47f8a7dfdc9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/create-foreign-table.xml
@@ -0,0 +1,23 @@
+<?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>
+    <create-foreign-table sql-case-id="create_foreign_table" />
+    <create-foreign-table sql-case-id="create_foreign_table_server_options" />
+    <create-foreign-table sql-case-id="create_foreign_table_without_table_elements" />
+</sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-foreign-table.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-foreign-table.xml
new file mode 100644
index 00000000000..c0634c219ee
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/create-foreign-table.xml
@@ -0,0 +1,23 @@
+<?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="create_foreign_table" value="CREATE FOREIGN TABLE addr_nsp.genftable (a int) SERVER addr_fserv;" db-types="PostgreSQL" />
+    <sql-case id="create_foreign_table_server_options" value="CREATE FOREIGN TABLE fd_pt2_1 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
+    <sql-case id="create_foreign_table_without_table_elements" value="CREATE FOREIGN TABLE tableam_fdw_heapx () SERVER fs_heap2;" 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 a8a57e5c821..dfe78336e71 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
@@ -3469,33 +3469,6 @@
     <sql-case id="alter_by_postgresql_source_test_case460" value="ALTER TYPE tt_t0 DROP ATTRIBUTE z;" db-types="PostgreSQL" />
     <sql-case id="analyze_by_postgresql_source_test_case1" value="ANALYZE (nonexistent-arg) does_not_exist;" db-types="PostgreSQL" />
     <sql-case id="create_by_postgresql_source_test_case124" value="CREATE CONSTRAINT TRIGGER trigtest_constraint AFTER INSERT OR UPDATE OR DELETE ON foreign_schema.foreign_table_1 FOR EACH ROW EXECUTE PROCEDURE dummy_trigger();" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case156" value="CREATE FOREIGN TABLE addr_nsp.genftable (a int) SERVER addr_fserv;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case157" value="CREATE FOREIGN TABLE fd_pt2_1 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case158" value="CREATE FOREIGN TABLE fd_pt2_1 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date, 	c4 char ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case159" value="CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)   SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case160" value="CREATE FOREIGN TABLE foreign_part PARTITION OF temp_parted DEFAULT   SERVER s0 CREATE FOREIGN TABLE foreign_part (a int) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case161" value="CREATE FOREIGN TABLE ft1 ( 	c1 integer OPTIONS (&quot;param 1&quot; &apos;val1&apos;) NOT NULL, 	c2 text OPTIONS (param2 &apos;val2&apos;, param3 &apos;val3&apos;) CHECK (c2 &lt;&gt; &apos;&apos;), 	c3 date, 	CHECK (c3 BETWEEN &apos;1994-01-01&apos;::date AND &apos;1994-01-31&apos;::date) ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case162" value="CREATE FOREIGN TABLE ft1 ( 	c1 integer OPTIONS (&quot;param 1&quot; &apos;val1&apos;) NOT NULL, 	c2 text OPTIONS (param2 &apos;val2&apos;, param3 &apos;val3&apos;), 	c3 date, 	UNIQUE (c3) ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case163" value="CREATE FOREIGN TABLE ft1 ( 	c1 integer OPTIONS (&quot;param 1&quot; &apos;val1&apos;) PRIMARY KEY, 	c2 text OPTIONS (param2 &apos;val2&apos;, param3 &apos;val3&apos;), 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case164" value="CREATE FOREIGN TABLE ft1 ( 	c1 integer OPTIONS (&quot;param 1&quot; &apos;val1&apos;) REFERENCES ref_table (id), 	c2 text OPTIONS (param2 &apos;val2&apos;, param3 &apos;val3&apos;), 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case165" value="CREATE FOREIGN TABLE ft1 () SERVER no_server;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case166" value="CREATE FOREIGN TABLE ft1 ();" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case167" value="CREATE FOREIGN TABLE ft1 (c1 integer NOT NULL) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case168" value="CREATE FOREIGN TABLE ft2 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case169" value="CREATE FOREIGN TABLE ft2 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date ) SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case170" value="CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1)   SERVER s0 OPTIONS (delimiter &apos;,&apos;, quote &apos;&quot;&apos;, &quot;be quoted&quot; &apos;value&apos;);" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case171" value="CREATE FOREIGN TABLE ft3 ( 	c1 integer NOT NULL, 	c2 text, 	c3 date ) INHERITS(ft2)   SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case172" value="CREATE FOREIGN TABLE ft_part1   PARTITION OF lt1 FOR VALUES FROM (0) TO (1000) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case173" value="CREATE FOREIGN TABLE ft_part1   PARTITION OF lt1 FOR VALUES FROM (0) TO (1000) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case174" value="CREATE FOREIGN TABLE ft_part1   PARTITION OF lt1 FOR VALUES FROM (0) TO (1000) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case175" value="CREATE FOREIGN TABLE ft_part2 (a INT NOT NULL) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case176" value="CREATE FOREIGN TABLE ft_part2 (a INT) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case177" value="CREATE FOREIGN TABLE ft_part_1_1   PARTITION OF lt1_part1 FOR VALUES FROM (0) TO (100) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case178" value="CREATE FOREIGN TABLE ft_part_1_1   PARTITION OF lt1_part1 FOR VALUES FROM (0) TO (100) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case179" value="CREATE FOREIGN TABLE ft_part_1_2 (a INT NOT NULL) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case180" value="CREATE FOREIGN TABLE ft_part_1_2 (a INT) SERVER s0;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case181" value="CREATE FOREIGN TABLE tststats.f (a int, b int, c text) SERVER extstats_dummy_srv;" db-types="PostgreSQL" />
-    <sql-case id="create_by_postgresql_source_test_case182" value="CREATE FOREIGN table tableam_fdw_heapx () SERVER fs_heap2;" db-types="PostgreSQL" />
     <sql-case id="create_by_postgresql_source_test_case183" value="CREATE FUNCTION addr_nsp.trig() RETURNS TRIGGER LANGUAGE plpgsql AS $$ BEGIN END; $$;" db-types="PostgreSQL" />
     <sql-case id="create_by_postgresql_source_test_case184" value="CREATE FUNCTION alter_op_test_fn(boolean, boolean) RETURNS boolean AS $$ SELECT NULL::BOOLEAN; $$ LANGUAGE sql IMMUTABLE;" db-types="PostgreSQL" />
     <sql-case id="create_by_postgresql_source_test_case185" value="CREATE FUNCTION alter_table_under_transition_tables_upd_func()   RETURNS TRIGGER   LANGUAGE plpgsql AS $$ BEGIN   RAISE WARNING &apos;old table = %, new table = %&apos;,                   (SELECT string_agg(id || &apos;=&apos; || name, &apos;,&apos;) FROM d),                   (SELECT string_agg(id || &apos;=&apos; || name, &apos;,&apos;) FROM i);   RAISE NOTICE &apos;one = %&apos;, (SELECT 1 FROM alter_table_under_transi [...]