seckill007 opened a new issue, #32565:
URL: https://github.com/apache/shardingsphere/issues/32565

   ## Bug Report
   In pgsql, the syntax ON CONFLICT (user_id,name) DO UPDATE SET is used, which 
cannot be routed to the real physical table when sharding.
   **For English only**, other languages will not accept.
    <insert id="insertUser" parameterType="java.util.List">
           INSERT INTO t_user (user_id, name, age)
           VALUES
           <foreach collection="list" item="item" index="index" separator=",">
               (#{item.userId}, #{item.name}, #{item.age})
           </foreach>
           ON CONFLICT (user_id,name) DO UPDATE SET
           age = EXCLUDED.age+t_user.age
       </insert>  
   when I used this pg sql style,shardingsphere didn't support. 
   Before report a bug, make sure you have:
   
![image](https://github.com/user-attachments/assets/d78b794e-19d0-4b1e-aa5f-506e26f24adf)
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
     <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>5.2.0</version>
           </dependency>
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   Actual SQL: db0 ::: INSERT INTO t_user2 (user_id, name, age)
           VALUES
             
               (?, ?, ?), (?, ?, ?)
            
           ON CONFLICT (user_id,name) DO UPDATE SET
           age = EXCLUDED.age + t_user2.age ::: [123, test, 10, 789, test3, 11] 
 
   ### Actual behavior
   Actual SQL: db0 ::: INSERT INTO t_user2 (user_id, name, age)
           VALUES
             
               (?, ?, ?), (?, ?, ?)
            
           ON CONFLICT (user_id,name) DO UPDATE SET
           age = EXCLUDED.age + t_user.age ::: [123, test, 10, 789, test3, 11]
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to