Xuzhengz opened a new issue, #5110:
URL: https://github.com/apache/seatunnel/issues/5110

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   seatunnel2.3.2 jdbc-sink的postgresql upsert 语法 只能9.5版本使用,不支持9.5以下版本,异常:
   
   
   ### SeaTunnel Version
   
   2.3.2
   
   ### SeaTunnel Config
   
   ```conf
   env {
     execution.parallelism = 2
     job.mode = "STREAMING"
     checkpoint.interval = 2000
     #execution.checkpoint.interval = 10000
     #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
   }
   
   source {
     MySQL-CDC {
       result_table_name = "ods_test_data1_1min"
       parallelism = 1
       username = "mysql"
       password = "******"
       table-names = ["test1mysql.data3_1min"]
       base-url = "jdbc:mysql://172.16.11.131:3306/test1mysql"
     }
   }
   
   sink {
       Jdbc {
           url = "jdbc:postgresql://172.16.8.31:5432/cdc?currentSchema=mysqlcdc"
           driver = "org.postgresql.Driver"
           user = "superadmin"
           source_table_name = "ods_test_data1_1min"
           password = "******"
           database = "mysqlcdc"
           table = "ods_test_data1_1min"
           support_upsert_by_query_primary_key_exist = true
           generate_sink_sql = true
           primary_keys = ["id"]
           batch_size = 5000
           batch_interval_ms = 3000
       }
   }
   ```
   
   
   ### Running Command
   
   ```shell
   bin/seatunnel.sh --config job.conf
   ```
   
   
   ### Error Exception
   
   ```log
   Caused by: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO 
mysqlcdc.ods_test_data1_1min (id, idStr, name, passwd, sfz, phone, bankCard, 
address, zipcode, company, email, birthDate, timestamp, lat, lng, imageUrl, 
files, COMMIT, 年龄, text, select2) VALUES (1665619735449178112, 's', NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL) ON CONFLICT (id) DO UPDATE SET id=EXCLUDED.id, 
idStr=EXCLUDED.idStr, name=EXCLUDED.name, passwd=EXCLUDED.passwd, 
sfz=EXCLUDED.sfz, phone=EXCLUDED.phone, bankCard=EXCLUDED.bankCard, 
address=EXCLUDED.address, zipcode=EXCLUDED.zipcode, company=EXCLUDED.company, 
email=EXCLUDED.email, birthDate=EXCLUDED.birthDate, 
timestamp=EXCLUDED.timestamp, lat=EXCLUDED.lat, lng=EXCLUDED.lng, 
imageUrl=EXCLUDED.imageUrl, files=EXCLUDED.files, COMMIT=EXCLUDED.COMMIT, 
年龄=EXCLUDED.年龄, text=EXCLUDED.text, select2=EXCLUDED.select2 was aborted: 
ERROR: syntax error at or near "ON"
   ```
   
   
   ### Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   <img width="1242" alt="image" 
src="https://github.com/apache/seatunnel/assets/90698333/b9c9fa4d-3ff7-4684-a0fc-e3baa44e240d";>
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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