【发布时间】:2022-04-20 18:05:42
【问题描述】:
我正在运行一项将所有数据从 postgres 10.4 迁移到 RDS postgres 10.4 的任务。 无法迁移具有 jsonb 列的表。 出错后,整个表被暂停。表只包含 449 行。
我制定了以下错误策略,但整个表仍然暂停。 "DataErrorPolicy": "IGNORE_RECORD", "DataTruncationErrorPolicy": "IGNORE_RECORD", "DataErrorEscalationPolicy": "SUSPEND_TABLE", "DataErrorEscalationCount": 1000,
我的期望是整个表应该被转移,如果任何 json 错误,它可以忽略记录。 我不知道为什么它会给出这个错误“类型 json 的输入语法无效”,我检查了所有 json 并且所有 json 都是有效的。
经过更多调试,这个错误一直被认为是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)
Edit-多调试后,这个错误一直被认为是TABLE错误,但是为什么?
【问题讨论】:
-
你能验证列中的数据是有效的 JSON 吗?
-
jsonb列中实际存在的数据
-
是的,但它是有效的 JSON 记录 raghavt.com/blog/2018/08/23/… 吗?
-
是的,所有的 json 都是正确的。我已经更新了问题。请检查。谢谢!
标签: postgresql aws-dms