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

   ## Feature Request
   
   **For English only**, other languages will not accept.
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot make decision by current information, 
we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   no.
   ### Describe the feature you would like.
   Hi,Team
   
   we hope shardingsphere can  support  postgres  merge opertion "insert into 
on conflct update",
   now when we excute sql 
   --------------------------------------
   INSERT INTO tb_user (id,name) VALUES (#{id},#{name}) ON CONFLICT (id) DO 
UPDATE SET name=#{name}
   --------------------------------------
   will get follow error:
   --------------------------------------
   2022-08-25 13:08:50.145 DEBUG 20200 --- [nio-8080-exec-1] 
test.UserMapper.merger                   : ==>  Preparing: INSERT INTO tb_user 
(id,name) VALUES (?,?) ON CONFLICT (id) DO UPDATE SET name=?
   2022-08-25 13:08:51.108 DEBUG 20200 --- [nio-8080-exec-1] 
test.UserMapper.merger                   : ==> Parameters: **id00(String), 
test_name(String), test_name(String)**
   2022-08-25 13:08:51.153  INFO 20200 --- [nio-8080-exec-1] ShardingSphere-SQL 
                      : Logic SQL: INSERT INTO tb_user (id,name) VALUES (?,?) 
ON CONFLICT (id) DO UPDATE SET name=?
   2022-08-25 13:08:51.153  INFO 20200 --- [nio-8080-exec-1] ShardingSphere-SQL 
                      : SQLStatement: 
PostgreSQLInsertStatement(withSegment=Optional.empty)
   2022-08-25 13:08:51.153  INFO 20200 --- [nio-8080-exec-1] ShardingSphere-SQL 
                      : Actual SQL: ds0 ::: INSERT INTO tb_user (id,name) 
VALUES (?,?) ON CONFLICT (id) DO UPDATE SET name=? ::: **[id00, test_name]**
   2022-08-25 13:08:51.196  INFO 20200 --- [nio-8080-exec-1] 
o.s.b.f.xml.XmlBeanDefinitionReader      : Loading XML bean definitions from 
class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
   2022-08-25 13:08:51.245  INFO 20200 --- [nio-8080-exec-1] 
o.s.jdbc.support.SQLErrorCodesFactory    : SQLErrorCodes loaded: [DB2, Derby, 
H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]
   2022-08-25 13:08:51.256 ERROR 20200 --- [nio-8080-exec-1] 
o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet 
[dispatcherServlet] in context with path [] threw exception [Request processing 
failed; nested exception is 
org.springframework.dao.DataIntegrityViolationException: 
   ### Error updating database.  Cause: org.postgresql.util.PSQLException: 
未设定参数值 3 的内容。
   ### The error may exist in test/UserMapper.java (best guess)
   ### The error may involve test.UserMapper.merger-Inline
   ### The error occurred while setting parameters
   ### SQL: INSERT INTO tb_user (id,name) VALUES (?,?) ON CONFLICT (id) DO 
UPDATE SET name=?
   ### Cause: org.postgresql.util.PSQLException: 未设定参数值 3 的内容。
   ; SQL []; 未设定参数值 3 的内容。; nested exception is 
org.postgresql.util.PSQLException: 未设定参数值 3 的内容。] with root cause
   
   


-- 
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