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:
nakeiven
2025-01-24 17:14:41 +08:00
committed by GitHub
parent c15129b0ac
commit c998b3f100
3 changed files with 21 additions and 3 deletions

View File

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

View File

@@ -313,6 +313,9 @@ public class SyncUtil {
case mariadb:
case oceanbase:
return "`";
// 当dbType 为 postgresql时,返回双引号(避免表名为postgresql的关键字时,sql查询报错)
case postgresql:
return "\"";
default:
return "";
}