Skip to content

[flink][cdc] PostgreSQL CDC corrupts binary field values - #10973

Merged
JingsongLi merged 1 commit into
apache:masterfrom
taoran92:fix/cdc-postgres-binary-values
Nov 4, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
taoran92:fix/cdc-postgres-binary-values

Conversation

@taoran92

@taoran92 taoran92 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Purpose

Closes #10972.

PostgreSQL CDC currently converts plain binary values from Base64 through a Java string, silently replacing bytes that are invalid in the default charset. For example, 00 FF 80 41 becomes 00 EF BF BD EF BF BD 41 on a UTF-8 JVM.

Preserve Base64 values in snapshot and WAL records and attach the existing binary-field markers so the sink restores the original bytes. Preserve computed-column text semantics and existing BIT/DECIMAL handling. Share binary-field selection between the PostgreSQL and MySQL parsers.

Tests

Add eight PostgreSQL regression tests covering arbitrary bytes, null and empty values, snapshot/update/delete records, marker isolation, logical types, computed columns, existing text columns, and table write/read round trips. Six of these tests fail with the previous PostgreSQL parser

@taoran92
taoran92 marked this pull request as ready for review November 3, 2026 11:25
@JingsongLi
JingsongLi merged commit b5193c0 into apache:master Nov 4, 2026
13 checks passed
@taoran92
taoran92 deleted the fix/cdc-postgres-binary-values branch November 5, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] PostgreSQL CDC corrupts binary field values

2 participants