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

strongduanmu 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 fd0812b3baa Fix PostgreSQL DML source and target visitors (#40204)
fd0812b3baa is described below

commit fd0812b3baa107703a3790b119f231c6a34decfa
Author: ZhangCheng <[email protected]>
AuthorDate: Fri Oct 16 19:22:57 2026 +0800

    Fix PostgreSQL DML source and target visitors (#40204)
    
    * Fix PostgreSQL DML source and target visitors
    
    * Normalize PostgreSQL DML parser formatting
    
    * Fix PostgreSQL INSERT target parameter traversal
---
 .../src/main/antlr4/imports/postgresql/BaseRule.g4 |  10 +
 .../main/antlr4/imports/postgresql/DMLStatement.g4 |  10 +-
 .../antlr4/imports/postgresql/PostgreSQLKeyword.g4 |   8 +
 .../parser/autogen/PostgreSQLStatementParser.g4    |   1 +
 .../statement/PostgreSQLStatementVisitor.java      |  53 +++-
 .../type/PostgreSQLDMLStatementVisitor.java        |   8 -
 .../parser/src/main/resources/case/dal/explain.xml |  31 +++
 .../parser/src/main/resources/case/dml/delete.xml  |   9 +
 test/it/parser/src/main/resources/case/dml/do.xml  |  12 +
 .../parser/src/main/resources/case/dml/insert.xml  | 284 ++++++++++++++++++++
 .../parser/src/main/resources/case/dml/merge.xml   | 290 +++++++++++++++++++++
 .../parser/src/main/resources/case/dml/select.xml  | 164 ++++++++++++
 .../parser/src/main/resources/case/dml/update.xml  | 101 +++++++
 .../main/resources/sql/supported/dal/explain.xml   |   2 +
 .../main/resources/sql/supported/dml/delete.xml    |   3 +-
 .../src/main/resources/sql/supported/dml/do.xml    |   6 +
 .../main/resources/sql/supported/dml/insert.xml    |  19 +-
 .../src/main/resources/sql/supported/dml/merge.xml |   8 +
 .../main/resources/sql/supported/dml/select.xml    |  11 +
 .../main/resources/sql/supported/dml/update.xml    |   8 +-
 20 files changed, 1014 insertions(+), 24 deletions(-)

diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
index 53d769eebe2..5a9f26664cb 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
@@ -155,6 +155,7 @@ unreservedWord
     | CHAIN
     | CHARACTERISTICS
     | CHECKPOINT
+    | CIDR
     | CLASS
     | CLOSE
     | CLUSTER
@@ -241,6 +242,7 @@ unreservedWord
     | INCREMENT
     | INDEX
     | INDEXES
+    | INET
     | INHERIT
     | INHERITS
     | INLINE
@@ -258,6 +260,7 @@ unreservedWord
     | LAST
     | LEAKPROOF
     | LEVEL
+    | LINE
     | LISTEN
     | LOAD
     | LOCAL
@@ -266,6 +269,8 @@ unreservedWord
     | LOCKED
     | LOGGED
     | LSEG
+    | MACADDR
+    | MACADDR8
     | MAIN
     | MAPPING
     | MATCH
@@ -408,6 +413,8 @@ unreservedWord
     | TRIGGER
     | TRUNCATE
     | TRUSTED
+    | TSQUERY
+    | TSVECTOR
     | TYPE
     | TYPES
     | TIME
@@ -426,6 +433,7 @@ unreservedWord
     | VALIDATE
     | VALIDATOR
     | VALUE
+    | VARBIT
     | VARYING
     | VERSION
     | VIEW
@@ -447,6 +455,8 @@ unreservedWord
     | TABLE
     | CONSTRAINT
     | COLLATION
+    | SOURCE
+    | TARGET
     ;
 
 typeFuncNameKeyword
diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/DMLStatement.g4
 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/DMLStatement.g4
index e6f4d52aff4..f99eac4c5c2 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/DMLStatement.g4
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/DMLStatement.g4
@@ -53,6 +53,7 @@ insertColumnItem
 optOnConflict
     : ON CONFLICT optConfExpr DO UPDATE SET setClauseList whereClause?
     | ON CONFLICT optConfExpr DO NOTHING
+    | ON CONFLICT optConfExpr DO SELECT forLockingStrength? whereClause?
     ;
 
 optConfExpr
@@ -76,7 +77,7 @@ setClause
     ;
 
 setTarget
-    : colId
+    : colId indirection?
     ;
 
 setTargetList
@@ -112,7 +113,8 @@ mergeUsingClause
 
 mergeWhenClause
     : WHEN MATCHED (AND aExpr)? THEN mergeMatchedThenClause
-    | WHEN NOT MATCHED (AND aExpr)? THEN mergeNotMatchedThenClause
+    | WHEN NOT MATCHED BY SOURCE (AND aExpr)? THEN mergeMatchedThenClause
+    | WHEN NOT MATCHED (BY TARGET)? (AND aExpr)? THEN mergeNotMatchedThenClause
     ;
 
 mergeMatchedThenClause
@@ -467,7 +469,9 @@ dostmtOptList
     ;
 
 dostmtOptItem
-    : STRING_ | LANGUAGE nonReservedWordOrSconst
+    : STRING_
+    | BEGIN_DOLLAR_STRING_CONSTANT DOLLAR_TEXT* END_DOLLAR_STRING_CONSTANT
+    | LANGUAGE nonReservedWordOrSconst
     ;
 
 copy
diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
index db7e6262533..ecedd952a54 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
@@ -1472,3 +1472,11 @@ ASENSITIVE
 DESCRIPTOR
     : D E S C R I P T O R
     ;
+
+SOURCE
+    : S O U R C E
+    ;
+
+TARGET
+    : T A R G E T
+    ;
diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
index cdc20c44092..4456ead60c8 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
@@ -60,6 +60,7 @@ execute
     | set
     | resetParameter
     | call
+    | doStatement
     | alterAggregate
     | alterCollation
     | alterFunction
diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/PostgreSQLStatementVisitor.java
 
b/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/PostgreSQLStatementVisitor.java
index 00f23b921f5..38c432a9d48 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/PostgreSQLStatementVisitor.java
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/PostgreSQLStatementVisitor.java
@@ -91,6 +91,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Pa
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.QualifiedNameContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.QualifiedNameListContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.RelationExprOptAliasContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ReturningClauseContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SchemaNameContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SelectClauseNContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SelectContext;
@@ -103,6 +104,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Se
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetClauseContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetClauseListContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetTargetContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetTargetListContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SignedIconstContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SimpleSelectContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SortClauseContext;
@@ -783,6 +785,11 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
         return actual;
     }
     
+    @Override
+    public ASTNode visitReturningClause(final ReturningClauseContext ctx) {
+        return new ReturningSegment(ctx.start.getStartIndex(), 
ctx.stop.getStopIndex(), (ProjectionsSegment) visit(ctx.targetList()));
+    }
+    
     @Override
     public ASTNode visitOptOnConflict(final OptOnConflictContext ctx) {
         Collection<ColumnAssignmentSegment> assignments = new LinkedList<>();
@@ -844,13 +851,6 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
     @Override
     public ASTNode visitInsertRest(final InsertRestContext ctx) {
         InsertStatement.InsertStatementBuilder result = 
InsertStatement.builder().databaseType(databaseType);
-        ValuesClauseContext valuesClause = 
ctx.select().selectNoParens().selectClauseN().simpleSelect().valuesClause();
-        if (null == valuesClause) {
-            SelectStatement selectStatement = (SelectStatement) 
visit(ctx.select());
-            result.insertSelect(new 
SubquerySegment(ctx.select().start.getStartIndex(), 
ctx.select().stop.getStopIndex(), selectStatement, 
getOriginalText(ctx.select())));
-        } else {
-            result.values(createInsertValuesSegments(valuesClause));
-        }
         if (null == ctx.insertColumnList()) {
             result.insertColumns(new 
InsertColumnsSegment(ctx.start.getStartIndex() - 1, ctx.start.getStartIndex() - 
1, Collections.emptyList()));
         } else {
@@ -859,6 +859,16 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
             InsertColumnsSegment insertColumnsSegment = new 
InsertColumnsSegment(insertColumns.start.getStartIndex() - 1, 
insertColumns.stop.getStopIndex() + 1, columns.getValue());
             result.insertColumns(insertColumnsSegment);
         }
+        if (null == ctx.DEFAULT()) {
+            SimpleSelectContext simpleSelect = 
ctx.select().selectNoParens().selectClauseN().simpleSelect();
+            ValuesClauseContext valuesClause = null == simpleSelect ? null : 
simpleSelect.valuesClause();
+            if (null == valuesClause) {
+                SelectStatement selectStatement = (SelectStatement) 
visit(ctx.select());
+                result.insertSelect(new 
SubquerySegment(ctx.select().start.getStartIndex(), 
ctx.select().stop.getStopIndex(), selectStatement, 
getOriginalText(ctx.select())));
+            } else {
+                result.values(createInsertValuesSegments(valuesClause));
+            }
+        }
         return result.build();
     }
     
@@ -875,9 +885,13 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
     
     @Override
     public ASTNode visitInsertColumnItem(final InsertColumnItemContext ctx) {
+        visit(ctx.optIndirection());
         if (null == ctx.optIndirection().indirectionEl()) {
             return new ColumnSegment(ctx.colId().start.getStartIndex(), 
ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText()));
         }
+        if (null == ctx.optIndirection().indirectionEl().attrName()) {
+            return new ColumnSegment(ctx.colId().start.getStartIndex(), 
ctx.optIndirection().stop.getStopIndex(), new 
IdentifierValue(ctx.colId().getText()));
+        }
         ColumnSegment result = new 
ColumnSegment(ctx.colId().start.getStartIndex(), 
ctx.optIndirection().stop.getStopIndex(),
                 new 
IdentifierValue(ctx.optIndirection().indirectionEl().attrName().getText()));
         result.setOwner(new OwnerSegment(ctx.colId().start.getStartIndex(), 
ctx.colId().stop.getStopIndex(), new IdentifierValue(ctx.colId().getText())));
@@ -920,15 +934,28 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
     
     @Override
     public ASTNode visitSetClause(final SetClauseContext ctx) {
-        ColumnSegment columnSegment = (ColumnSegment) visit(ctx.setTarget());
         List<ColumnSegment> columnSegments = new LinkedList<>();
-        columnSegments.add(columnSegment);
+        if (null == ctx.setTarget()) {
+            appendSetTargets(ctx.setTargetList(), columnSegments);
+        } else {
+            columnSegments.add((ColumnSegment) visit(ctx.setTarget()));
+        }
         ExpressionSegment expressionSegment = (ExpressionSegment) 
visit(ctx.aExpr());
         return new ColumnAssignmentSegment(ctx.start.getStartIndex(), 
ctx.stop.getStopIndex(), columnSegments, expressionSegment);
     }
     
+    private void appendSetTargets(final SetTargetListContext ctx, final 
Collection<ColumnSegment> columns) {
+        if (null != ctx.setTargetList()) {
+            appendSetTargets(ctx.setTargetList(), columns);
+        }
+        columns.add((ColumnSegment) visit(ctx.setTarget()));
+    }
+    
     @Override
     public ASTNode visitSetTarget(final SetTargetContext ctx) {
+        if (null != ctx.indirection()) {
+            visit(ctx.indirection());
+        }
         IdentifierValue identifierValue = new 
IdentifierValue(ctx.colId().getText());
         return new ColumnSegment(ctx.start.getStartIndex(), 
ctx.stop.getStopIndex(), identifierValue);
     }
@@ -980,7 +1007,13 @@ public abstract class PostgreSQLStatementVisitor extends 
PostgreSQLStatementPars
     
     @Override
     public ASTNode visitWhereOrCurrentClause(final WhereOrCurrentClauseContext 
ctx) {
-        return visit(ctx.whereClause());
+        if (null != ctx.whereClause()) {
+            return visit(ctx.whereClause());
+        }
+        int startIndex = ctx.CURRENT().getSymbol().getStartIndex();
+        int stopIndex = ctx.stop.getStopIndex();
+        String text = ctx.start.getInputStream().getText(new 
Interval(startIndex, stopIndex));
+        return new WhereSegment(ctx.start.getStartIndex(), stopIndex, new 
CommonExpressionSegment(startIndex, stopIndex, text));
     }
     
     @Override
diff --git 
a/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java
 
b/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java
index 6aca2eb1cef..2196f1939da 100644
--- 
a/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java
+++ 
b/parser/sql/engine/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/engine/postgresql/visitor/statement/type/PostgreSQLDMLStatementVisitor.java
@@ -29,13 +29,10 @@ import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Co
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CopyWithTableOrQueryContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.DoStatementContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.PreparableStmtContext;
-import 
org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ReturningClauseContext;
 import 
org.apache.shardingsphere.sql.parser.engine.postgresql.visitor.statement.PostgreSQLStatementVisitor;
-import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.ReturningSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.column.ColumnSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.complex.CommonExpressionSegment;
-import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.item.ProjectionsSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.prepare.PrepareStatementQuerySegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dml.CallStatement;
@@ -129,9 +126,4 @@ public final class PostgreSQLDMLStatementVisitor extends 
PostgreSQLStatementVisi
     public ASTNode visitCopyWithTableBinary(final CopyWithTableBinaryContext 
ctx) {
         return new PostgreSQLCopyStatement(getDatabaseType(), null == 
ctx.qualifiedName() ? null : (SimpleTableSegment) visit(ctx.qualifiedName()), 
Collections.emptyList(), null);
     }
-    
-    @Override
-    public ASTNode visitReturningClause(final ReturningClauseContext ctx) {
-        return new ReturningSegment(ctx.start.getStartIndex(), 
ctx.stop.getStopIndex(), (ProjectionsSegment) visit(ctx.targetList()));
-    }
 }
diff --git a/test/it/parser/src/main/resources/case/dal/explain.xml 
b/test/it/parser/src/main/resources/case/dal/explain.xml
index 556f1ae7872..5e1e859ad46 100644
--- a/test/it/parser/src/main/resources/case/dal/explain.xml
+++ b/test/it/parser/src/main/resources/case/dal/explain.xml
@@ -1789,4 +1789,35 @@
             </where>
         </select>
     </explain>
+
+    <explain sql-case-id="explain_insert_returning_star_pg">
+        <insert>
+            <table name="t_order" start-index="20" stop-index="26" />
+            <columns start-index="27" stop-index="27" />
+            <values>
+                <value>
+                    <assignment-value>
+                        <literal-expression value="1" start-index="36" 
stop-index="36" />
+                    </assignment-value>
+                </value>
+            </values>
+            <returning>
+                <projections start-index="49" stop-index="49">
+                    <shorthand-projection start-index="49" stop-index="49" />
+                </projections>
+            </returning>
+        </insert>
+    </explain>
+
+    <explain sql-case-id="explain_insert_default_returning_pg">
+        <insert>
+            <table name="t_order" start-index="20" stop-index="26" />
+            <columns start-index="27" stop-index="27" />
+            <returning>
+                <projections start-index="53" stop-index="60">
+                    <column-projection name="order_id" start-index="53" 
stop-index="60" />
+                </projections>
+            </returning>
+        </insert>
+    </explain>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/delete.xml 
b/test/it/parser/src/main/resources/case/dml/delete.xml
index 463f81efbf7..08738c17f80 100644
--- a/test/it/parser/src/main/resources/case/dml/delete.xml
+++ b/test/it/parser/src/main/resources/case/dml/delete.xml
@@ -1031,4 +1031,13 @@
             </expr>
         </where>
     </delete>
+
+    <delete sql-case-id="delete_current_of_quoted_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <where start-index="20" stop-index="41">
+            <expr>
+                <common-expression text="current of &quot;Foo&quot;" 
start-index="26" stop-index="41" />
+            </expr>
+        </where>
+    </delete>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/do.xml 
b/test/it/parser/src/main/resources/case/dml/do.xml
index 5fba8bffe32..c4008d3b5ca 100644
--- a/test/it/parser/src/main/resources/case/dml/do.xml
+++ b/test/it/parser/src/main/resources/case/dml/do.xml
@@ -148,4 +148,16 @@
             </function>
         </parameter>
     </do>
+
+    <do sql-case-id="do_quoted_code_pg" />
+
+    <do sql-case-id="do_dollar_code_pg" />
+
+    <do sql-case-id="do_tagged_code_pg" />
+
+    <do sql-case-id="do_empty_dollar_code_pg" />
+
+    <do sql-case-id="do_language_before_pg" />
+
+    <do sql-case-id="do_language_after_pg" />
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/insert.xml 
b/test/it/parser/src/main/resources/case/dml/insert.xml
index a6d385d6839..ed6fcefa970 100644
--- a/test/it/parser/src/main/resources/case/dml/insert.xml
+++ b/test/it/parser/src/main/resources/case/dml/insert.xml
@@ -5941,4 +5941,288 @@
             </value>
         </values>
     </insert>
+
+    <insert sql-case-id="insert_default_values_returning_pg">
+        <table name="t_order" start-index="12" stop-index="29" alias="bar">
+            <owner name="foo" start-index="12" stop-index="14" />
+        </table>
+        <columns start-index="30" stop-index="30" />
+        <returning>
+            <projections start-index="56" stop-index="60">
+                <shorthand-projection start-index="56" stop-index="60">
+                    <owner name="bar" start-index="56" stop-index="58" />
+                </shorthand-projection>
+            </projections>
+        </returning>
+    </insert>
+
+    <insert sql-case-id="insert_parenthesized_query_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="19" stop-index="19" />
+        <select>
+            <projections start-index="28" stop-index="28">
+                <expression-projection text="1" start-index="28" 
stop-index="28">
+                    <expr>
+                        <literal-expression value="1" start-index="28" 
stop-index="28" />
+                    </expr>
+                </expression-projection>
+            </projections>
+        </select>
+    </insert>
+
+    <insert sql-case-id="insert_nested_parenthesized_query_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="19" stop-index="19" />
+        <select>
+            <projections start-index="29" stop-index="29">
+                <expression-projection text="1" start-index="29" 
stop-index="29">
+                    <expr>
+                        <literal-expression value="1" start-index="29" 
stop-index="29" />
+                    </expr>
+                </expression-projection>
+            </projections>
+        </select>
+    </insert>
+
+    <insert sql-case-id="insert_union_query_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="19" stop-index="19" />
+        <select>
+            <projections start-index="27" stop-index="27">
+                <expression-projection text="1" start-index="27" 
stop-index="27">
+                    <expr>
+                        <literal-expression value="1" start-index="27" 
stop-index="27" />
+                    </expr>
+                </expression-projection>
+            </projections>
+            <combine combine-type="UNION_ALL" start-index="20" stop-index="46">
+                <left>
+                    <projections start-index="27" stop-index="27">
+                        <expression-projection text="1" start-index="27" 
stop-index="27">
+                            <expr>
+                                <literal-expression value="1" start-index="27" 
stop-index="27" />
+                            </expr>
+                        </expression-projection>
+                    </projections>
+                </left>
+                <right>
+                    <projections start-index="46" stop-index="46">
+                        <expression-projection text="2" start-index="46" 
stop-index="46">
+                            <expr>
+                                <literal-expression value="2" start-index="46" 
stop-index="46" />
+                            </expr>
+                        </expression-projection>
+                    </projections>
+                </right>
+            </combine>
+        </select>
+    </insert>
+
+    <insert sql-case-id="insert_array_element_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="30">
+            <column name="status" start-index="21" stop-index="29" />
+        </columns>
+        <values>
+            <value>
+                <assignment-value>
+                    <literal-expression value="foo" start-index="40" 
stop-index="44" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_array_slice_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="35">
+            <column name="status" start-index="21" stop-index="34" />
+        </columns>
+        <values>
+            <value>
+                <assignment-value>
+                    <literal-expression value="foo" start-index="45" 
stop-index="49" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_member_target_pg">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="33">
+            <column name="value" start-index="21" stop-index="32">
+            <owner name="status" start-index="21" stop-index="26" />
+            </column>
+        </columns>
+        <values>
+            <value>
+                <assignment-value>
+                    <literal-expression value="foo" start-index="43" 
stop-index="47" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_returning_pg">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="35">
+                <assignment-value>
+                    <literal-expression value="1" start-index="34" 
stop-index="34" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="37" stop-index="61" />
+        <returning start-index="63" stop-index="73">
+            <projections start-index="73" stop-index="73">
+                <column-projection name="a" start-index="73" stop-index="73" />
+            </projections>
+        </returning>
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_key_share_pg">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="35">
+                <assignment-value>
+                    <literal-expression value="1" start-index="34" 
stop-index="34" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="37" stop-index="75" />
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_share_where_pg">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="35">
+                <assignment-value>
+                    <literal-expression value="1" start-index="34" 
stop-index="34" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="37" stop-index="83" />
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_no_key_update_pg">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="35">
+                <assignment-value>
+                    <literal-expression value="1" start-index="34" 
stop-index="34" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="37" stop-index="79" />
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_parameters_pg" parameters="1, 
1" parameter-marker-count="2">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="36">
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="0" 
start-index="34" stop-index="35" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="38" stop-index="86" />
+        <returning start-index="88" stop-index="98">
+            <projections start-index="98" stop-index="98">
+                <column-projection name="a" start-index="98" stop-index="98" />
+            </projections>
+        </returning>
+    </insert>
+
+    <insert sql-case-id="insert_conflict_select_constraint_pg">
+        <table name="foo_table" start-index="12" stop-index="20" />
+        <columns start-index="22" stop-index="24">
+            <column name="a" start-index="23" stop-index="23" />
+        </columns>
+        <values>
+            <value start-index="33" stop-index="35">
+                <assignment-value>
+                    <literal-expression value="1" start-index="34" 
stop-index="34" />
+                </assignment-value>
+            </value>
+        </values>
+        <on-duplicate-key-columns start-index="37" stop-index="78" />
+    </insert>
+
+    <insert sql-case-id="insert_array_parameters_pg" parameters="1, 2, 3" 
parameter-marker-count="4">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="44">
+            <column name="status" start-index="21" stop-index="34" />
+            <column name="user_id" start-index="37" stop-index="43" />
+        </columns>
+        <values>
+            <value start-index="53" stop-index="60">
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="2" 
start-index="54" stop-index="55" />
+                </assignment-value>
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="1" 
start-index="58" stop-index="59" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_array_jdbc_parameters_pg" parameters="1, 2, 3, 
4" parameter-marker-count="4">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="42">
+            <column name="status" start-index="21" stop-index="32" />
+            <column name="user_id" start-index="35" stop-index="41" />
+        </columns>
+        <values>
+            <value start-index="51" stop-index="56">
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="2" 
start-index="52" stop-index="52" />
+                </assignment-value>
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="3" 
start-index="55" stop-index="55" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_array_slice_parameters_pg" parameters="1, 2, 
3, 4" parameter-marker-count="4">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="38">
+            <column name="status" start-index="21" stop-index="37" />
+        </columns>
+        <values>
+            <value start-index="47" stop-index="50">
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="3" 
start-index="48" stop-index="49" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
+
+    <insert sql-case-id="insert_array_slice_jdbc_parameters_pg" parameters="1, 
2, 3, 4" parameter-marker-count="4">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <columns start-index="20" stop-index="35">
+            <column name="status" start-index="21" stop-index="34" />
+        </columns>
+        <values>
+            <value start-index="44" stop-index="46">
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="3" 
start-index="45" stop-index="45" />
+                </assignment-value>
+            </value>
+        </values>
+    </insert>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/merge.xml 
b/test/it/parser/src/main/resources/case/dml/merge.xml
index 05a9b6bffcc..0121824279f 100644
--- a/test/it/parser/src/main/resources/case/dml/merge.xml
+++ b/test/it/parser/src/main/resources/case/dml/merge.xml
@@ -1458,4 +1458,294 @@
             <delete />
         </merge-items>
     </merge>
+
+    <merge sql-case-id="merge_not_matched_source_delete_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY SOURCE THEN DELETE" 
start-index="36" stop-index="73">
+            <delete />
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_not_matched_source_update_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY SOURCE AND t.id &gt; 0 THEN 
UPDATE SET v = 1" start-index="36" stop-index="96">
+            <expr>
+                <binary-operation-expression start-index="67" stop-index="74">
+                    <left>
+                        <column name="id" start-index="67" stop-index="70">
+                            <owner name="t" start-index="67" stop-index="67" />
+                        </column>
+                    </left>
+                    <operator>&gt;</operator>
+                    <right>
+                        <literal-expression value="0" start-index="74" 
stop-index="74" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+            <update>
+                <set start-index="88" stop-index="96">
+                    <assignment start-index="92" stop-index="96">
+                        <column name="v" start-index="92" stop-index="92" />
+                        <assignment-value>
+                            <literal-expression value="1" start-index="96" 
stop-index="96" />
+                        </assignment-value>
+                    </assignment>
+                </set>
+            </update>
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_not_matched_source_nothing_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY SOURCE THEN DO NOTHING" 
start-index="36" stop-index="77">
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_not_matched_target_insert_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY TARGET THEN INSERT (id) VALUES 
(s.id)" start-index="36" stop-index="92">
+            <insert>
+                <columns start-index="75" stop-index="78">
+                    <column name="id" start-index="76" stop-index="77" />
+                </columns>
+                <values>
+                    <value start-index="87" stop-index="92">
+                        <assignment-value>
+                            <column name="id" start-index="88" stop-index="91">
+                                <owner name="s" start-index="88" 
stop-index="88" />
+                            </column>
+                        </assignment-value>
+                    </value>
+                </values>
+            </insert>
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_not_matched_target_nothing_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY TARGET THEN DO NOTHING" 
start-index="36" stop-index="77">
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_mixed_match_modes_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN MATCHED THEN UPDATE SET v = 1" 
start-index="36" stop-index="69">
+            <update>
+                <set start-index="61" stop-index="69">
+                    <assignment start-index="65" stop-index="69">
+                        <column name="v" start-index="65" stop-index="65" />
+                        <assignment-value>
+                            <literal-expression value="1" start-index="69" 
stop-index="69" />
+                        </assignment-value>
+                    </assignment>
+                </set>
+            </update>
+        </merge-items>
+        <merge-items text="WHEN NOT MATCHED BY SOURCE THEN DELETE" 
start-index="71" stop-index="108">
+            <delete />
+        </merge-items>
+        <merge-items text="WHEN NOT MATCHED BY TARGET THEN INSERT (id) VALUES 
(s.id)" start-index="110" stop-index="166">
+            <insert>
+                <columns start-index="149" stop-index="152">
+                    <column name="id" start-index="150" stop-index="151" />
+                </columns>
+                <values>
+                    <value start-index="161" stop-index="166">
+                        <assignment-value>
+                            <column name="id" start-index="162" 
stop-index="165">
+                                <owner name="s" start-index="162" 
stop-index="162" />
+                            </column>
+                        </assignment-value>
+                    </value>
+                </values>
+            </insert>
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_not_matched_insert_control_pg">
+        <target>
+            <simple-table name="t" start-index="11" stop-index="11" />
+        </target>
+        <source>
+            <simple-table name="s" start-index="19" stop-index="19" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="24" stop-index="34">
+                <left>
+                    <column name="id" start-index="24" stop-index="27">
+                        <owner name="t" start-index="24" stop-index="24" />
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="31" stop-index="34">
+                        <owner name="s" start-index="31" stop-index="31" />
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED THEN INSERT (id) VALUES (s.id)" 
start-index="36" stop-index="82">
+            <insert>
+                <columns start-index="65" stop-index="68">
+                    <column name="id" start-index="66" stop-index="67" />
+                </columns>
+                <values>
+                    <value start-index="77" stop-index="82">
+                        <assignment-value>
+                            <column name="id" start-index="78" stop-index="81">
+                                <owner name="s" start-index="78" 
stop-index="78" />
+                            </column>
+                        </assignment-value>
+                    </value>
+                </values>
+            </insert>
+        </merge-items>
+    </merge>
+
+    <merge sql-case-id="merge_source_target_identifiers_pg">
+        <target>
+            <simple-table name="target" start-index="11" stop-index="16" />
+        </target>
+        <source>
+            <simple-table name="source" start-index="24" stop-index="29" />
+        </source>
+        <expr>
+            <binary-operation-expression start-index="34" stop-index="54">
+                <left>
+                    <column name="id" start-index="34" stop-index="42">
+                        <owner name="target" start-index="34" stop-index="39" 
/>
+                    </column>
+                </left>
+                <operator>=</operator>
+                <right>
+                    <column name="id" start-index="46" stop-index="54">
+                        <owner name="source" start-index="46" stop-index="51" 
/>
+                    </column>
+                </right>
+            </binary-operation-expression>
+        </expr>
+        <merge-items text="WHEN NOT MATCHED BY SOURCE THEN DELETE" 
start-index="56" stop-index="93">
+            <delete />
+        </merge-items>
+    </merge>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/select.xml 
b/test/it/parser/src/main/resources/case/dml/select.xml
index d949c3c4ff1..2f76b6ba954 100644
--- a/test/it/parser/src/main/resources/case/dml/select.xml
+++ b/test/it/parser/src/main/resources/case/dml/select.xml
@@ -15509,6 +15509,170 @@
         </projections>
     </select>
 
+    <select sql-case-id="select_cast_tsvector_name_pg">
+        <projections start-index="7" stop-index="21">
+            <expression-projection text="'foo'::tsvector" start-index="7" 
stop-index="21">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="foo" start-index="7" 
stop-index="11" />
+                        </expression>
+                        <data-type>tsvector</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_tsquery_name_pg">
+        <projections start-index="7" stop-index="20">
+            <expression-projection text="'foo'::tsquery" start-index="7" 
stop-index="20">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="foo" start-index="7" 
stop-index="11" />
+                        </expression>
+                        <data-type>tsquery</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_varbit_name_pg">
+        <projections start-index="7" stop-index="20">
+            <expression-projection text="'0101'::varbit" start-index="7" 
stop-index="20">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="0101" start-index="7" 
stop-index="12" />
+                        </expression>
+                        <data-type>varbit</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_inet_name_pg">
+        <projections start-index="7" stop-index="23">
+            <expression-projection text="'127.0.0.1'::inet" start-index="7" 
stop-index="23">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="127.0.0.1" 
start-index="7" stop-index="17" />
+                        </expression>
+                        <data-type>inet</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_cidr_name_pg">
+        <projections start-index="7" stop-index="25">
+            <expression-projection text="'127.0.0.0/8'::cidr" start-index="7" 
stop-index="25">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="127.0.0.0/8" 
start-index="7" stop-index="19" />
+                        </expression>
+                        <data-type>cidr</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_macaddr_name_pg">
+        <projections start-index="7" stop-index="34">
+            <expression-projection text="'08:00:2b:01:02:03'::macaddr" 
start-index="7" stop-index="34">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="08:00:2b:01:02:03" 
start-index="7" stop-index="25" />
+                        </expression>
+                        <data-type>macaddr</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_macaddr8_name_pg">
+        <projections start-index="7" stop-index="41">
+            <expression-projection text="'08:00:2b:01:02:03:04:05'::macaddr8" 
start-index="7" stop-index="41">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression 
value="08:00:2b:01:02:03:04:05" start-index="7" stop-index="31" />
+                        </expression>
+                        <data-type>macaddr8</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_cast_line_name_pg">
+        <projections start-index="7" stop-index="21">
+            <expression-projection text="'{1,2,3}'::line" start-index="7" 
stop-index="21">
+                <expr>
+                    <type-cast-expression>
+                        <expression>
+                            <literal-expression value="{1,2,3}" 
start-index="7" stop-index="15" />
+                        </expression>
+                        <data-type>line</data-type>
+                    </type-cast-expression>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_tsvector_function_name_pg">
+        <projections start-index="7" stop-index="21">
+            <expression-projection text="tsvector('foo')" start-index="7" 
stop-index="21">
+                <expr>
+                    <function function-name="tsvector" text="tsvector('foo')" 
start-index="7" stop-index="21">
+                        <parameter>
+                            <literal-expression value="foo" start-index="16" 
stop-index="20" />
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_tsquery_function_name_pg">
+        <projections start-index="7" stop-index="20">
+            <expression-projection text="tsquery('foo')" start-index="7" 
stop-index="20">
+                <expr>
+                    <function function-name="tsquery" text="tsquery('foo')" 
start-index="7" stop-index="20">
+                        <parameter>
+                            <literal-expression value="foo" start-index="15" 
stop-index="19" />
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_type_keyword_columns_pg">
+        <from>
+            <simple-table name="foo" start-index="75" stop-index="77" />
+        </from>
+        <projections start-index="7" stop-index="68">
+            <column-projection name="tsvector" start-index="7" stop-index="14" 
/>
+            <column-projection name="tsquery" start-index="17" stop-index="23" 
/>
+            <column-projection name="varbit" start-index="26" stop-index="31" 
/>
+            <column-projection name="inet" start-index="34" stop-index="37" />
+            <column-projection name="cidr" start-index="40" stop-index="43" />
+            <column-projection name="macaddr" start-index="46" stop-index="52" 
/>
+            <column-projection name="macaddr8" start-index="55" 
stop-index="62" />
+            <column-projection name="line" start-index="65" stop-index="68" />
+        </projections>
+    </select>
+
     <select sql-case-id="select_where_is_not_distinct_from_firebird" 
parameters="'init'">
         <from>
             <simple-table name="t_order" start-index="21" stop-index="27" />
diff --git a/test/it/parser/src/main/resources/case/dml/update.xml 
b/test/it/parser/src/main/resources/case/dml/update.xml
index 93898159bb0..bd7d549ad62 100644
--- a/test/it/parser/src/main/resources/case/dml/update.xml
+++ b/test/it/parser/src/main/resources/case/dml/update.xml
@@ -2847,4 +2847,105 @@
             </assignment>
         </set>
     </update>
+
+    <update sql-case-id="update_tuple_literal_pg">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="48">
+            <assignment start-index="19" stop-index="48">
+                <columns name="user_id" start-index="20" stop-index="26" />
+                <columns name="status" start-index="29" stop-index="34" />
+                <assignment-value>
+                    <common-expression text="(1, 'foo')" start-index="39" 
stop-index="48" />
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
+
+    <update sql-case-id="update_tuple_subquery_pg">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="55">
+            <assignment start-index="19" stop-index="55">
+                <columns name="user_id" start-index="20" stop-index="26" />
+                <columns name="status" start-index="29" stop-index="34" />
+                <assignment-value>
+                    <subquery start-index="39" stop-index="55">
+                        <select>
+                            <projections start-index="47" stop-index="54">
+                                <expression-projection text="1" 
start-index="47" stop-index="47">
+                                    <expr>
+                                        <literal-expression value="1" 
start-index="47" stop-index="47" />
+                                    </expr>
+                                </expression-projection>
+                                <expression-projection text="'foo'" 
start-index="50" stop-index="54">
+                                    <expr>
+                                        <literal-expression value="foo" 
start-index="50" stop-index="54" />
+                                    </expr>
+                                </expression-projection>
+                            </projections>
+                        </select>
+                    </subquery>
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
+
+    <update sql-case-id="update_array_element_pg">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="35">
+            <assignment start-index="19" stop-index="35">
+                <column name="status" start-index="19" stop-index="27" />
+                <assignment-value>
+                    <literal-expression value="foo" start-index="31" 
stop-index="35" />
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
+
+    <update sql-case-id="update_array_slice_pg">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="40">
+            <assignment start-index="19" stop-index="40">
+                <column name="status" start-index="19" stop-index="32" />
+                <assignment-value>
+                    <literal-expression value="foo" start-index="36" 
stop-index="40" />
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
+
+    <update sql-case-id="update_array_parameter_pg" parameters="1, 'foo'">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="33">
+            <assignment start-index="19" stop-index="33">
+                <column name="status" start-index="19" stop-index="28" />
+                <assignment-value>
+                    <parameter-marker-expression parameter-index="1" 
start-index="32" stop-index="33" />
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
+
+    <update sql-case-id="update_member_target_pg">
+        <table start-index="7" stop-index="13">
+            <simple-table name="t_order" start-index="7" stop-index="13" />
+        </table>
+        <set start-index="15" stop-index="38">
+            <assignment start-index="19" stop-index="38">
+                <column name="status" start-index="19" stop-index="30" />
+                <assignment-value>
+                    <literal-expression value="foo" start-index="34" 
stop-index="38" />
+                </assignment-value>
+            </assignment>
+        </set>
+    </update>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/explain.xml 
b/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
index 580ee55d930..c3476ec2f4a 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/explain.xml
@@ -89,4 +89,6 @@
     <sql-case id="explain_for_select_group_by_multi_columns" value="explain 
plan for select p.prod_name, t.time_id, sum(s.amount_sold) from sales s, times 
t, products p where s.time_id = t.time_id and s.prod_id = p.prod_id and 
t.fiscal_year = 2000 and t.fiscal_week_number = 3 and p.prod_category = 
'Hardware' group by t.time_id, p.prod_name;" db-types="Oracle"/>
     <sql-case id="explain_for_select_in_sub_query" value="explain plan for 
select sum(amount_sold) from sales where time_id in (select time_id from times 
where fiscal_year = 2000);" db-types="Oracle"/>
     <sql-case id="explain_for_select_between_to_date_function" value="explain 
plan for select sum(amount_sold) from sales where time_id between 
to_date('01-JAN-2000','dd-MON-yyyy') and to_date('31-DEC-2000','dd-MON-yyyy') 
;" db-types="Oracle"/>
+    <sql-case id="explain_insert_returning_star_pg" value="EXPLAIN INSERT INTO 
t_order VALUES (1) RETURNING *" db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="explain_insert_default_returning_pg" value="EXPLAIN INSERT 
INTO t_order DEFAULT VALUES RETURNING order_id" db-types="PostgreSQL" 
case-types="Literal" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/delete.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/delete.xml
index caa718160e0..eb09794ccbf 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/delete.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/delete.xml
@@ -46,7 +46,7 @@
     <sql-case id="delete_with_partition" value="DELETE FROM sales PARTITION 
(sales_q1_1998) WHERE amount_sold > 1000" db-types="Oracle" />
     <sql-case id="delete_with_table" value="DELETE product_price_history" 
db-types="Oracle" />
     <sql-case id="delete_table_collection_oracle" value="DELETE FROM 
TABLE(SELECT nested_col FROM t_nested) WHERE nested_col = 1" db-types="Oracle" 
/>
-    <sql-case id="delete_with_current_of_oracle" value="DELETE FROM t_order 
WHERE CURRENT OF order_cursor" db-types="Oracle" />
+    <sql-case id="delete_with_current_of_oracle" value="DELETE FROM t_order 
WHERE CURRENT OF order_cursor" db-types="Oracle,PostgreSQL" />
     <sql-case id="delete_with_schema" value="DELETE FROM db1.t_order" />
     <sql-case id="delete_with_simple_condition" value="DELETE FROM 
Q1_2000_sales WHERE amount_sold &lt; 0" db-types="Oracle" />
     <sql-case id="delete_with_output_clause_with_compress_function" 
value="DELETE FROM player OUTPUT deleted.id,deleted.name, 
deleted.surname,deleted.datemodifier,COMPRESS(deleted.info) INTO 
dbo.inactivePlayers WHERE datemodified &lt; @startOfYear" db-types="SQLServer" 
/>
@@ -57,4 +57,5 @@
     <sql-case id="delete_with_where" value="DELETE FROM orders WHERE order_id 
= 9527;" db-types="Hive" />
     <sql-case id="delete_without_where_sql92" value="DELETE FROM t_order" 
db-types="SQL92" />
     <sql-case id="delete_with_where_sql92" value="DELETE FROM t_order WHERE 
order_id = 1" db-types="SQL92" />
+    <sql-case id="delete_current_of_quoted_pg" value="delete from t_order 
where current of &quot;Foo&quot;" db-types="PostgreSQL" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/do.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/do.xml
index 399f96dc4b7..280be13c419 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/do.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/do.xml
@@ -26,4 +26,10 @@
     <sql-case id="do_with_function_4" value="DO ST_AsText(@centroid_point) as 
centroid" db-types="MySQL" />
     <sql-case id="do_with_function_5" value="DO SLEEP(5) as t, SLEEP(5) as t1" 
db-types="MySQL" />
     <sql-case id="do_with_crc32_function" value="DO 
CRC32(CHAR(1.134475E+308))" db-types="MySQL" />
+    <sql-case id="do_quoted_code_pg" value="DO 'BEGIN NULL; END;'" 
db-types="PostgreSQL" />
+    <sql-case id="do_dollar_code_pg" value="DO $$BEGIN PERFORM 1; END$$;" 
db-types="PostgreSQL" />
+    <sql-case id="do_tagged_code_pg" value="DO $body$BEGIN PERFORM '$inner$'; 
END;$body$;" db-types="PostgreSQL" />
+    <sql-case id="do_empty_dollar_code_pg" value="DO $$$$" 
db-types="PostgreSQL" />
+    <sql-case id="do_language_before_pg" value="DO LANGUAGE plpgsql $$BEGIN 
NULL; END$$" db-types="PostgreSQL" />
+    <sql-case id="do_language_after_pg" value="DO $$BEGIN NULL; END$$ LANGUAGE 
'plpgsql'" db-types="PostgreSQL" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/insert.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/insert.xml
index fbffa3cde33..bf68c896f37 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/insert.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/insert.xml
@@ -82,7 +82,7 @@
     <sql-case id="insert_without_columns_with_with_clause" value="WITH cte AS 
(SELECT order_id, user_id FROM t_order) INSERT INTO t_order (order_id, user_id) 
SELECT order_id, user_id FROM cte" db-types="SQLServer" />
     <sql-case id="insert_without_into_keyword" value="INSERT t_order 
(order_id, user_id, status) VALUES (?, ?, ?)" db-types="MySQL,SQLServer" />
     <sql-case id="insert_with_default_values" value="INSERT INTO t_order 
(order_id, user_id, status) DEFAULT VALUES" db-types="SQLServer" />
-    <sql-case id="insert_without_columns_with_default_values" value="INSERT 
INTO t_order DEFAULT VALUES" db-types="SQLServer" />
+    <sql-case id="insert_without_columns_with_default_values" value="INSERT 
INTO t_order DEFAULT VALUES" db-types="SQLServer,PostgreSQL" />
     <sql-case id="insert_with_top" value="INSERT TOP(10) t_order (order_id, 
user_id) SELECT order_id, user_id FROM t_order" db-types="SQLServer" />
     <sql-case id="insert_with_top_percent" value="INSERT TOP(10) PERCENT 
t_order (order_id, user_id) SELECT order_id, user_id FROM t_order" 
db-types="SQLServer" />
     <sql-case id="insert_with_uuid_column" value="insert into t_order 
(id,uuid) values (?, ?)" db-types="PostgreSQL,openGauss" />
@@ -213,4 +213,21 @@
     <sql-case id="insert_returning_into_parameter_marker_oracle" value="INSERT 
INTO t_user (user_id, user_name) VALUES (?, ?) RETURNING user_id INTO ?" 
db-types="Oracle" />
     <sql-case id="insert_on_conflit_do_update" value="INSERT INTO t_order ( 
c1, c2, c3 ) VALUES ( ?, now(), ? ) ON CONFLICT ( c1, c3 ) DO UPDATE set c2 = 
now() WHERE user_id= ?" db-types="PostgreSQL" />
     <sql-case id="insert_with_schema_database_link_oracle" value="INSERT INTO 
userinfo.USER_CONSIS_LIST@pjzw (telnum) VALUES (?)" db-types="Oracle" />
+    <sql-case id="insert_default_values_returning_pg" value="INSERT INTO 
foo.t_order AS bar DEFAULT VALUES RETURNING bar.*" db-types="PostgreSQL" />
+    <sql-case id="insert_parenthesized_query_pg" value="INSERT INTO t_order 
(SELECT 1)" db-types="PostgreSQL" />
+    <sql-case id="insert_nested_parenthesized_query_pg" value="INSERT INTO 
t_order ((SELECT 1))" db-types="PostgreSQL" />
+    <sql-case id="insert_union_query_pg" value="INSERT INTO t_order SELECT 1 
UNION ALL SELECT 2" db-types="PostgreSQL" />
+    <sql-case id="insert_array_element_pg" value="INSERT INTO t_order 
(status[1]) VALUES ('foo')" db-types="PostgreSQL" />
+    <sql-case id="insert_array_slice_pg" value="INSERT INTO t_order 
(status[1:2][2]) VALUES ('foo')" db-types="PostgreSQL" />
+    <sql-case id="insert_member_target_pg" value="INSERT INTO t_order 
(status.value) VALUES ('foo')" db-types="PostgreSQL" />
+    <sql-case id="insert_conflict_select_returning_pg" value="INSERT INTO 
foo_table (a) VALUES (1) ON CONFLICT (a) DO SELECT RETURNING a" 
db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="insert_conflict_select_key_share_pg" value="INSERT INTO 
foo_table (a) VALUES (1) ON CONFLICT (a) DO SELECT FOR KEY SHARE" 
db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="insert_conflict_select_share_where_pg" value="INSERT INTO 
foo_table (a) VALUES (1) ON CONFLICT (a) DO SELECT FOR SHARE WHERE a &gt; 0" 
db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="insert_conflict_select_no_key_update_pg" value="INSERT INTO 
foo_table (a) VALUES (1) ON CONFLICT (a) DO SELECT FOR NO KEY UPDATE" 
db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="insert_conflict_select_parameters_pg" value="INSERT INTO 
foo_table (a) VALUES ($1) ON CONFLICT (a) DO SELECT FOR UPDATE WHERE a = $2 
RETURNING a" db-types="PostgreSQL" case-types="Placeholder" />
+    <sql-case id="insert_conflict_select_constraint_pg" value="INSERT INTO 
foo_table (a) VALUES (1) ON CONFLICT ON CONSTRAINT foo_pk DO SELECT" 
db-types="PostgreSQL" case-types="Literal" />
+    <sql-case id="insert_array_parameters_pg" value="INSERT INTO t_order 
(status[$2][$1], user_id) VALUES ($3, $2)" db-types="PostgreSQL" 
case-types="Placeholder" />
+    <sql-case id="insert_array_jdbc_parameters_pg" value="INSERT INTO t_order 
(status[?][?], user_id) VALUES (?, ?)" db-types="PostgreSQL" 
case-types="Placeholder" />
+    <sql-case id="insert_array_slice_parameters_pg" value="INSERT INTO t_order 
(status[$1:$2][$3]) VALUES ($4)" db-types="PostgreSQL" case-types="Placeholder" 
/>
+    <sql-case id="insert_array_slice_jdbc_parameters_pg" value="INSERT INTO 
t_order (status[?:?][?]) VALUES (?)" db-types="PostgreSQL" 
case-types="Placeholder" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/merge.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/merge.xml
index 6fb411c8944..4bbbc231b6d 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/merge.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/merge.xml
@@ -54,4 +54,12 @@
     <sql-case id="merge_pg_with_condition_and_multiple_whens" value="MERGE 
INTO t_merge_target USING t_merge_source ON t_merge_target.order_id = 
t_merge_source.order_id WHEN MATCHED AND t_merge_target.status = 
t_merge_source.status THEN UPDATE SET status = t_merge_source.status WHEN NOT 
MATCHED THEN DO NOTHING" db-types="PostgreSQL" />
     <sql-case id="merge_pg_with_returning" value="MERGE INTO t_merge_target 
USING t_merge_source ON t_merge_target.order_id = t_merge_source.order_id WHEN 
MATCHED THEN UPDATE SET status = t_merge_source.status RETURNING 
t_merge_target.order_id" db-types="PostgreSQL" />
     <sql-case id="merge_pg_using_subquery" value="MERGE INTO t_merge_target 
USING (SELECT order_id FROM t_merge_source) AS src ON t_merge_target.order_id = 
src.order_id WHEN MATCHED THEN DELETE" db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_source_delete_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED BY SOURCE THEN DELETE" 
db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_source_update_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED BY SOURCE AND t.id &gt; 0 THEN UPDATE 
SET v = 1" db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_source_nothing_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED BY SOURCE THEN DO NOTHING" 
db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_target_insert_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED BY TARGET THEN INSERT (id) VALUES 
(s.id)" db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_target_nothing_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED BY TARGET THEN DO NOTHING" 
db-types="PostgreSQL" />
+    <sql-case id="merge_mixed_match_modes_pg" value="MERGE INTO t USING s ON 
t.id = s.id WHEN MATCHED THEN UPDATE SET v = 1 WHEN NOT MATCHED BY SOURCE THEN 
DELETE WHEN NOT MATCHED BY TARGET THEN INSERT (id) VALUES (s.id)" 
db-types="PostgreSQL" />
+    <sql-case id="merge_not_matched_insert_control_pg" value="MERGE INTO t 
USING s ON t.id = s.id WHEN NOT MATCHED THEN INSERT (id) VALUES (s.id)" 
db-types="PostgreSQL" />
+    <sql-case id="merge_source_target_identifiers_pg" value="MERGE INTO target 
USING source ON target.id = source.id WHEN NOT MATCHED BY SOURCE THEN DELETE" 
db-types="PostgreSQL" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/select.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
index 3ecfcd5360c..a2d82b48af1 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
@@ -587,6 +587,17 @@
     <sql-case id="select_in_with_owner_column_rhs_oracle" value="SELECT * FROM 
t_order o WHERE o.user_id IN o.order_id" db-types="Oracle" />
     <sql-case id="select_in_with_function_rhs_oracle" value="SELECT * FROM 
t_order o WHERE o.user_id IN NVL(o.order_id, 0)" db-types="Oracle" />
     <sql-case id="select_parenthesized_column_alias" value="SELECT 
(c.password) PASSWORD FROM t_account c" 
db-types="Oracle,PostgreSQL,openGauss,SQLServer,Hive" />
+    <sql-case id="select_cast_tsvector_name_pg" value="SELECT 'foo'::tsvector" 
db-types="PostgreSQL" />
+    <sql-case id="select_cast_tsquery_name_pg" value="SELECT 'foo'::tsquery" 
db-types="PostgreSQL" />
+    <sql-case id="select_cast_varbit_name_pg" value="SELECT '0101'::varbit" 
db-types="PostgreSQL" />
+    <sql-case id="select_cast_inet_name_pg" value="SELECT '127.0.0.1'::inet" 
db-types="PostgreSQL" />
+    <sql-case id="select_cast_cidr_name_pg" value="SELECT '127.0.0.0/8'::cidr" 
db-types="PostgreSQL" />
+    <sql-case id="select_cast_macaddr_name_pg" value="SELECT 
'08:00:2b:01:02:03'::macaddr" db-types="PostgreSQL" />
+    <sql-case id="select_cast_macaddr8_name_pg" value="SELECT 
'08:00:2b:01:02:03:04:05'::macaddr8" db-types="PostgreSQL" />
+    <sql-case id="select_cast_line_name_pg" value="SELECT '{1,2,3}'::line" 
db-types="PostgreSQL" />
+    <sql-case id="select_tsvector_function_name_pg" value="SELECT 
tsvector('foo')" db-types="PostgreSQL" />
+    <sql-case id="select_tsquery_function_name_pg" value="SELECT 
tsquery('foo')" db-types="PostgreSQL" />
+    <sql-case id="select_type_keyword_columns_pg" value="SELECT tsvector, 
tsquery, varbit, inet, cidr, macaddr, macaddr8, line FROM foo" 
db-types="PostgreSQL" />
     <sql-case id="select_where_is_not_distinct_from_firebird" value="SELECT 
order_id FROM t_order WHERE status IS NOT DISTINCT FROM ?" db-types="Firebird" 
/>
     <sql-case id="select_where_starting_with_firebird" value="SELECT order_id 
FROM t_order WHERE status STARTING WITH ?" db-types="Firebird" />
     <sql-case id="select_where_similar_to_escape_firebird" value="SELECT 
order_id FROM t_order WHERE status SIMILAR TO ? ESCAPE ?" db-types="Firebird" />
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/update.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/update.xml
index d850d8bbc97..9c41b01d3a3 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/update.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/update.xml
@@ -55,7 +55,7 @@
     <sql-case id="update_with_set_value_clause" value="UPDATE ot1 SET 
VALUE(ot1.x) = t1(20) WHERE VALUE(ot1.x) = t1(10);" db-types="Oracle" />
     <sql-case id="update_with_subquery_target_oracle" value="UPDATE (SELECT * 
FROM employees) SET salary = 1" db-types="Oracle" />
     <sql-case id="update_with_dblink_oracle" value="UPDATE employees@remote 
SET salary = salary" db-types="Oracle" />
-    <sql-case id="update_with_current_of_oracle" value="UPDATE t_order SET 
status = 'OK' WHERE CURRENT OF order_cursor" db-types="Oracle" />
+    <sql-case id="update_with_current_of_oracle" value="UPDATE t_order SET 
status = 'OK' WHERE CURRENT OF order_cursor" db-types="Oracle,PostgreSQL" />
     <sql-case id="update_with_open_row_set_function" value="UPDATE T SET 
XmlCol = ( SELECT * FROM OPENROWSET(BULK 'C:\SampleFolder\SampleData3.txt', 
SINGLE_BLOB) AS x) WHERE IntCol = 1" db-types="SQLServer"/>
     <sql-case id="update_with_point_type" value="UPDATE dbo.Cities SET 
Location.SetXY(23.5, 23.5) WHERE Name = 'Anchorage'" db-types="SQLServer"/>
     <sql-case id="update_with_table_hint" value="UPDATE Production.Product 
WITH (TABLOCK) SET ListPrice = ListPrice * 1.10 WHERE ProductNumber LIKE 
'BK-%'" db-types="SQLServer"/>
@@ -85,4 +85,10 @@
     <sql-case id="update_with_where_sql92" value="UPDATE t_order SET status = 
'x' WHERE order_id = 1" db-types="SQL92" />
     <sql-case id="update_set_default_oracle" value="UPDATE employees SET 
status = DEFAULT WHERE employee_id = 1" db-types="Oracle" />
     <sql-case id="update_table_collection_oracle" value="UPDATE TABLE(SELECT 
nested_col FROM t_nested) SET nested_col = DEFAULT" db-types="Oracle" />
+    <sql-case id="update_tuple_literal_pg" value="UPDATE t_order SET (user_id, 
status) = (1, 'foo')" db-types="PostgreSQL" />
+    <sql-case id="update_tuple_subquery_pg" value="UPDATE t_order SET 
(user_id, status) = (SELECT 1, 'foo')" db-types="PostgreSQL" />
+    <sql-case id="update_array_element_pg" value="UPDATE t_order SET status[1] 
= 'foo'" db-types="PostgreSQL" />
+    <sql-case id="update_array_slice_pg" value="UPDATE t_order SET 
status[1:2][2] = 'foo'" db-types="PostgreSQL" />
+    <sql-case id="update_array_parameter_pg" value="UPDATE t_order SET 
status[$1] = $2" db-types="PostgreSQL" case-types="Placeholder" />
+    <sql-case id="update_member_target_pg" value="UPDATE t_order SET 
status.value = 'foo'" db-types="PostgreSQL" />
 </sql-cases>

Reply via email to