Skip to content

mysql数据表同步到postgresql数据库,由于字段列顺序不完全对应导致同步问题 #109

Description

@dwwang1992

使用 debezium+kafka+bireme 同步方式

1、数据源mysql表broad,字段顺序为id(id为主键) info city,数据如下:
+----+---------+----------+
| id | info | city |
+----+---------+----------+
| 1 | record1 | hangzhou |
| 2 | record1 | hangzhou |
| 3 | c | c |
| 4 | c | c |
| 5 | c | c |
| 6 | c | c |
| 7 | c | c |
| 8 | c | c |
| 9 | c | c |
| 10 | c | c |
+----+---------+----------+

2、目标库postgresql表broad,字段顺序为city id(id为主键) info(和数据源顺序不完全对应)
bireme同步结束后,数据如下
target=> select * from broad;
city | id | info
----------+----+---------
hangzhou | 2 | record1
c | 10 | c

出现了部分数据的同步
如果字段顺序完全对应,同步无异常

这种字段顺序不完全对应的出现部分数据同步,如何修复呢?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions