- Newest
- Most votes
- Most comments
The error you're encountering is related to how AWS DMS is handling null values in the uuid[] column during the Change Data Capture (CDC) phase. It appears that DMS is converting null values to empty strings, which are not valid for uuid[] columns in PostgreSQL.
To resolve this issue, you can try the following approaches:
-
Use a transformation rule: You can create a transformation rule in your DMS task to handle null values correctly. Add a rule that converts empty strings back to null for the specific column. This can be done using the 'CASE' expression in a transformation rule.
-
Adjust target endpoint settings: In your target endpoint settings, you can add an extra connection attribute to handle null values differently. Try adding the following attribute:
emptyStringIsNull=true
This tells DMS to treat empty strings as null values when inserting into the target database. -
Modify source endpoint settings: If the issue persists, you might need to adjust how the source database handles the uuid[] column. In your source endpoint settings, add the following extra connection attribute:
captureDdls=N
This disables DDL capture, which might help with the uuid[] column handling. -
Update DMS version: Ensure you're using the latest version of AWS DMS, as newer versions often include bug fixes and improvements in handling various data types.
-
Consider using LOB settings: Although you have Full LOB mode enabled, you might want to experiment with different LOB settings. Try adjusting the 'LobChunkSize' or switching to 'LimitedSizeLobMode' to see if it affects how the uuid[] column is handled.
If these solutions don't resolve the issue, you may need to consider creating a custom pre-processing script on the source database or a post-processing script on the target database to handle the uuid[] column data appropriately.
Remember to test any changes in a non-production environment first to ensure they don't cause any unintended consequences.
Sources
DMS between two RDS instances, grown OldestReplicationSlotLag | AWS re:Post
AWS DMS table load error at target: invalid byte sequence for encoding UTF8 | AWS re:Post
For your first suggestion, I cannot find any documentation on what type of transformation rule allows me to change the content of a column using a case statement. Can you provide an example?
I can emphasize as per previous recommendation that switching to LimitedSizeLobMode is the recommended solution for this specific issue with uuid[] columns and changing to Limited LOB Mode should resolve the "malformed array literal" error you're experiencing during CDC replication.
To implement this, focus specifically on modifying these two settings in your TargetMetadata configuration:
"FullLobMode": false, "LimitedSizeLobMode": true
Here are examples of transformation https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Transformations.html