使用datax迁移pgsql数据如何配置能使同步重复的主键id不报错
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 5.7k
- PR merge metrics
- No merged PRs in 30d
Description
使用网上介绍的再writer的preSql中配置insert into target_table(id,data) values(?,?) on conflict(id) do nothing;会报错:
经DataX智能分析,该任务最可能的错误原因是:
com.alibaba.datax.common.exception.DataXException: Code:[DBUtilErrorCode-06], Description:[执行数据库 Sql 失败, 请检查您的配置的 column/table/where/querySql或者向 DBA 寻求帮助.]. - 执行的SQL为: insert into target_table(id,data) values(?,?) on conflict(id) do nothing; 具体错误信息为:org.postgresql.util.PSQLException: 错误: 语法错误 在 "," 或附近的
请问如何能使datax同步pgsql重复的主键id时不报错?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the DataX writer preSql configuration shown in the issue and trace how it is executed against PostgreSQL. Reproduce the reported syntax error with the target_table statement, then verify a supported configuration or behavior that completes synchronization when duplicate primary-key ids are encountered without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100