You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2025/02/03 09:59:06 UTC

Re: [PR] Fix `on conflict` error and add support for other `on conflict` queries in Postgres [shardingsphere]

strongduanmu commented on code in PR #34227:
URL: https://github.com/apache/shardingsphere/pull/34227#discussion_r1939101288


##########
parser/sql/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/PostgreSQLStatementVisitor.java:
##########
@@ -704,7 +704,7 @@ public ASTNode visitInsert(final InsertContext ctx) {
         PostgreSQLInsertStatement result = (PostgreSQLInsertStatement) visit(ctx.insertRest());
         result.setTable((SimpleTableSegment) visit(ctx.insertTarget()));
         if (null != ctx.optOnConflict()) {
-            result.setOnDuplicateKeyColumnsSegment((OnDuplicateKeyColumnsSegment) visit(ctx.optOnConflict()));
+            result.setOnConflictKeyColumnsSegment((OnConflictKeyColumnsSegment) visit(ctx.optOnConflict()));

Review Comment:
   It looks like we can enhance the existing OnDuplicateKeyColumnsSegment to support some special cases in PostgreSQL.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org