SymmetricDS Postgres目标为所有sym_ *表提供“无法读取表”
我试图设置从MySQL到Postgres的简单复制。 相同的模式。 按照演示教程中的步骤进行一些小改动(使用MySQL和Postgres驱动程序)后,我仍然无法使复制工作。
根据运行bin/sym
之后的投诉,需要进行一些更改
-
SET GLOBAL show_compatibility_56 = ON
需要在MySQL DB中设置SET GLOBAL show_compatibility_56 = ON
- 对于Postgres,我需要使用
protocolVersion=3
而不是在示例中设置的2。
奇怪的是,SymmetricDS能够创buildsym_*
表,但抱怨不能读取它们。 我已经validation了在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并不抱怨无法连接,并且能够创build表,所以我认为它与Docker无关。
Postgres数据库中的数据库是由engines/store-001.properties
指定的相同用户创build的。 这仍然可以与angular色和访问权限有关吗?
如果从Postgres升级到最新的JDBC驱动程序,它将起作用。
从最新的lib目录中replace现有的Postgres驱动程序: https : //jdbc.postgresql.org/download.html
尝试使用来自某个数据库导航器(例如Jetbrain的Datagrip)的symmetric-ds使用的相同用户名/密码连接到postgres数据库,然后尝试插入,更新,从sym_ *表中select一些内容。 必要时为用户分配访问权限。
当使用Postgres 9.6.1(当前的最新版本)时,在运行bin/sym
时服务器上会logging以下错误
ERROR: column am.amcanorder does not exist at character 427
这个问题已经通过使用Postgres 9.5.5解决了,这要归功于Nick Barnes在评论中指出了这一点。