我正在尝试设置从mySQL到Postgres的简单复制。相同的模式。在遵循演示教程中的步骤并进行了略有更改(使用MySQL和Postgres驱动程序)之后,我仍然无法使复制工作。
根据运行bin/sym
-
SET GLOBAL show_compatibility_56 = ON
需要在MySQL DB
中设置 - 对于Postgres,我需要使用
protocolVersion=3
而不是示例中设置的2个。
奇怪的是,Symmetricds能够创建sym_*
表,但抱怨无法阅读它们。我已经验证了在运行bin/sym
之前的表不存在,但之后确实存在。这是从日志
// Successful creation of table
[store-001] - PostgreSqlSymmetricDialect - DDL applied: CREATE TABLE "sym_notification"(
"notification_id" VARCHAR(128) NOT NULL,
...
PRIMARY KEY ("notification_id")
)
...
// Unable to read from created table
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_notification
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_notification
[store-001] - AbstractDatabaseWriter - Did not find the sym_notification table in the target database
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_monitor
[store-001] - PostgreSqlDdlReader - Failed to read table: sym_monitor
[store-001] - AbstractDatabaseWriter - Did not find the sym_monitor table in the target database
同样的错误适用于所有sym_*
表。
数据库在Docker中运行,但是由于Symmetricds并未抱怨无法连接,并且能够创建表,所以我认为它与Docker无关。
Postgres DB中的数据库是由engines/store-001.properties
中指定的同一用户创建的。这仍然与角色和访问特权有关吗?
如果您升级到Postgres的最新JDBC驱动程序,它将起作用。
从此处替换来自LIB目录的现有Postgres驱动程序:
尝试连接到Postgres数据库,其中与来自某些DB Navigator的Symmetric-DS使用的相同用户名/密码,例如JetBrain的DataGrip,然后尝试插入,更新,从SYMS_*中选择某些内容表。如有必要,将访问权利分配给用户。
使用Postgres 9.6.1(当前最新版本)运行bin/sym
ERROR: column am.amcanorder does not exist at character 427
通过使用Postgres 9.5.5而解决了问题,这要归功于Nick Barnes在评论中指出了这一点。