Skip to content

fix(postgres): support column casting for multi-row inserts#379

Open
nbarrientos wants to merge 1 commit intoAiven-Open:masterfrom
nbarrientos:ib_postgres_cast
Open

fix(postgres): support column casting for multi-row inserts#379
nbarrientos wants to merge 1 commit intoAiven-Open:masterfrom
nbarrientos:ib_postgres_cast

Conversation

@nbarrientos
Copy link
Copy Markdown

Previously, when configuring the sink connector with insert.mode=multi for a PostgreSQL database, the parent class GenericDatabaseDialect was responsible for generating the multi-row insert SQL. This "bypassed" the PostgreSQL dialect's specific casting logic (e.g., casting a string to jsonb if the column has that type).

This patch overrides buildMultiInsertStatement within the PostgreSQL dialect. This ensures multi-row inserts now behave consistently with single-row inserts, properly applying all required column casts (by calling transformColumn).

Previously, when configuring the sink connector with
`insert.mode=multi` for a PostgreSQL database, the parent class
`GenericDatabaseDialect` was responsible for generating the multi-row
insert SQL. This bypassed the PostgreSQL dialect's specific casting
logic (e.g., casting a string to `jsonb` if the column has that type).

This patch overrides `buildMultiInsertStatement` within the PostgreSQL
dialect. This ensures multi-row inserts now behave consistently with
single-row inserts, properly applying all required column casts (by
calling `transformColumn`).
@nbarrientos nbarrientos requested a review from a team as a code owner May 6, 2026 07:56
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.

1 participant