json aws dms postgres 类型的无效输入语法

Vij*_*pta 2 postgresql aws-dms

我正在运行一项将所有数据从 postgres 10.4 迁移到 RDS postgres 10.4 的任务。无法迁移具有 jsonb 列的表。出错后,整个表被挂起。表只包含 449 行。

我制定了以下错误政策,仍然整个表暂停。“DataErrorPolicy”:“IGNORE_RECORD”,“DataTruncationErrorPolicy”:“IGNORE_RECORD”,“DataErrorEscalationPolicy”:“SUSPEND_TABLE”,“DataErrorEscalationCount”:1000,

我的期望是应该传输整个表,如果任何json错误,它可以忽略记录。我不知道为什么它会给出这个错误“类型 json 的输入语法无效”,我已经检查了所有 json 并且所有 jsons 都是有效的。

经过多次调试,这个错误已经被认为是TABLE错误,但是为什么呢?这就是为什么表因为 TableErrorPolicy 是“SUSPEND_TABLE”而被挂起的原因。为什么这个错误被认为是表错误而不是记录错误?

DMS 不支持 JSONB 列,这就是为什么我们遇到以下错误?

日志:-

2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Next table to load 'public'.'TEMP_TABLE' ID = 1, order = 0 (tasktablesmanager.c:1817)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Start loading table 'public'.'TEMP_TABLE' (Id = 1) by subtask 1. 
Start load timestamp 0005AE3F66381F0F (replicationtask_util.c:755)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: REPLICA IDENTITY information for table 'public'.'TEMP_TABLE': Query status='Success' Type='DEFAULT' 
Description='Old values of the Primary Key columns (if any) will be captured.' (postgres_endpoint_unload.c:191)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Unload finished for table 'public'.'TEMP_TABLE' (Id = 1). 449 rows sent. (streamcomponent.c:3485)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Table 'public'.'TEMP_TABLE' contains LOB columns, change working mode to default mode (odbc_endpoint_imp.c:4775)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Table 'public'.'TEMP_TABLE' has Non-Optimized Full LOB Support (odbc_endpoint_imp.c:4788)
2020-09-01T12:10:04 https://forums.aws.amazon.com/I: Load finished for table 'public'.'TEMP_TABLE' (Id = 1). 449 rows received. 0 rows skipped.
Volume transferred 190376. (streamcomponent.c:3770)
2020-09-01T12:10:04 https://forums.aws.amazon.com/E: RetCode: SQL_ERROR SqlState: 22P02 NativeError: 1 Message: ERROR: invalid input syntax for type json; 
Error while executing the query https://forums.aws.amazon.com/ (ar_odbc_stmt.c:2648)
2020-09-01T12:10:04 https://forums.aws.amazon.com/W: Table 'public'.'TEMP_TABLE' (subtask 1 thread 1) is suspended (replicationtask.c:2471)
Run Code Online (Sandbox Code Playgroud)

编辑-调试更多后,此错误已被视为 TABLE错误,但为什么呢?

Vij*_*pta 5

JSONB 列数据类型在目标数据库中必须可以为空。

注意 - 就我而言,在将 JSONB 列设置为可为空后,此错误消失了。

正如 AWS 文档中所述-

在这种情况下,AWS DMS 将 JSONB 数据视为 LOB 列。在迁移的完全加载阶段,目标列必须可以为空。

https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.Prerequisites

https://aws.amazon.com/premiumsupport/knowledge-center/dms-error-null-value-column/