mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Feature/adapter postgresql 20250124 (#5390)
* adapter tcp模式mysql数据全量同步至postgresql时 报错 fix issue 2146 * fix issue 1980 * feat 增加 当dbType 为 postgresql时,返回双引号(避免表名为postgresql的关键字时,sql查询报错) --------- Co-authored-by: guodong.zhang <zgd8988@126.com>
This commit is contained in:
@@ -294,7 +294,7 @@ public class RdbSyncService {
|
||||
batchExecutor.execute(insertSql.toString(), values);
|
||||
} catch (SQLException e) {
|
||||
if (skipDupException
|
||||
&& (e.getMessage().contains("Duplicate entry") || e.getMessage().startsWith("ORA-00001:"))) {
|
||||
&& (e.getMessage().contains("Duplicate entry") || e.getMessage().contains("duplicate key") || e.getMessage().startsWith("ORA-00001:"))) {
|
||||
// ignore
|
||||
// TODO 增加更多关系数据库的主键冲突的错误码
|
||||
} else {
|
||||
|
||||
@@ -313,6 +313,9 @@ public class SyncUtil {
|
||||
case mariadb:
|
||||
case oceanbase:
|
||||
return "`";
|
||||
// 当dbType 为 postgresql时,返回双引号(避免表名为postgresql的关键字时,sql查询报错)
|
||||
case postgresql:
|
||||
return "\"";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user